bagelesque has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl $input = @ARGV[0]; open (INFILE, $input) || die "Unable to open @ARGV[0]!\n"; @lines = <INFILE>; close(INFILE); $output = ">output.txt"; open (OUTFILE, $output) || die "Unable to open output.txt!\n"; $frontfill = "INSERT INTO urls (URL, CATEGORY) VALUES ('"; $backfill = "', 'General');"; foreach (@lines) { chomp($lines[$x]); print OUTFILE $frontfill; print OUTFILE $lines[$x]; print OUTFILE $backfill; print OUTFILE "\n"; $x++; } close(OUTFILE);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: parsing error?
by miyagawa (Chaplain) on Dec 03, 2001 at 16:04 UTC | |
by MZSanford (Curate) on Dec 03, 2001 at 17:02 UTC | |
by bagelesque (Initiate) on Dec 03, 2001 at 16:44 UTC | |
|
Re: parsing error?
by larryk (Friar) on Dec 03, 2001 at 15:55 UTC | |
|
Re: parsing error?
by Beatnik (Parson) on Dec 03, 2001 at 18:26 UTC | |
|
Re: parsing error?
by MZSanford (Curate) on Dec 03, 2001 at 18:56 UTC | |
|
Re: parsing error?
by Fastolfe (Vicar) on Dec 03, 2001 at 21:58 UTC |