RE: search and replace confusion



Jason Balicki wrote:
> Wagner, David --- Senior Programmer Analyst --- WGO
> <mailto:David.Wagner@xxxxxxxxxxxxxxxxx> wrote:
>> The above seems to be what you stated you wanted. I did nothing
>> else in processing. I am running on AS Perl 5.8.3 build 809
>
> Thanks, any guesses as to what's wrong with my outer
> loop?
>
> --J(K)

Since you are using strict and warnings, I am unsure. For me I would change your code from:

foreach my $argnum (0 .. $#ARGV){
my $inputfile = $ARGV[$argnum];

to

while ( defined $ARGV[0] ) {
my $inputfile = $ARGV[0];
shift(@ARGV);

are the files you are processing from the same environment or a different one? If different, then it might be invalid translation of end of line? Otherwise it sounds like you are doing the processing, so you are reading the files and if this is true, then sounds like not what your perl is expecting for end of line.

Wags ;)


*******************************************************
This message contains information that is confidential
and proprietary to FedEx Freight or its affiliates.
It is intended only for the recipient named and for
the express purpose(s) described therein.
Any other use is prohibited.
*******************************************************

.



Relevant Pages

  • Re: page 124 of the camel book
    ... I am trying to write something in perl that has on outer while, an inner ... It depends on what the variables $x and $y are doing inside the loop. ...
    (comp.lang.perl.misc)
  • Re: Python equivalent for perls "next"-statement?
    ... > for that specific outer loop. ... Python doesn't have a continue block either, ... in Python than it does in Perl, since it matches up with the current ...
    (comp.lang.python)
  • RE: search and replace confusion
    ... I am running on AS Perl 5.8.3 build 809 ... any guesses as to what's wrong with my outer ... Prev by Date: ...
    (perl.beginners)
  • Re: Need help understanding how a file input block works
    ... here is a section of the Perl code that I am having ... ^ says 'match if we are at the start of the string', ... 'next' is documented in perldoc perl, in the sextion "Loop Control". ... which will stop you from using globals by accident. ...
    (comp.lang.perl.misc)
  • Re: perl newbie: leaner code ideas
    ... > To learn Perl, I have written a bit of code that needs to do the following: ... Don't declare variables prematurely. ... if the foreach loop contriol variable has already been ... variable as a foreach loop contriol variable without an explicit "my". ...
    (comp.lang.perl)