[Chicago-talk] @ARGV while(<>)
Andy_Bach at wiwb.uscourts.gov
Andy_Bach at wiwb.uscourts.gov
Fri Jan 4 14:09:49 PST 2008
#!/usr/bin/perl5 -w
@ARGV = $infile;
my $body = "";
while(<>) {
unless(/epsf\[/) {
$body = $body . $_;
}
Er, $infile isn't defined so you should always hang. You're also missing
the close paren for the unless
while(<>) {
unless(/epsf\[/) {
$body = $body . $_;
} # unless(/epsf\[/)
} # while <>
so one guesses these are typo/copy-o issue though. Normally you'd just
have (call it no_epsf.pl):
#!/usr/bin/perl5 -w
use strict;
my $body = "";
while(<>) {
unless(/epsf\[/) {
$body = $body . $_;
} # unless(/epsf\[/)
} # while <>
and run it
$ no_epsf.pl filename
one guess you want, though
$ no_epsf.pl filename > noepsf_filename
so:
#!/usr/bin/perl5 -w
use strict;
while(<>) {
print unless /epsf\[/;
} # while <>
would work for that.
s
Andy Bach
Systems Mangler
Internet: andy_bach at wiwb.uscourts.gov
VOICE: (608) 261-5738 FAX 264-5932
And the users exclaimed with a snarl and a taunt,
"It's just what we asked for, but not what we want!"
More information about the Chicago-talk
mailing list