On Thu, Apr 26, 2007 at 01:38:02AM +0100, Seanie wrote:
As a general rule, if your script contains 'system()' anywhere in it, you've
done it wrong.
I think this is a little strong. Or a little general. Or something.
Sometimes a calling system() is exactly the right thing to do.
Sometimes
`cat m.top.html m.mid.html m.arc.html m.bot.html blah`
How can this be done without a system call?
Here's my first guess:
@doc = ();
for (qw/m.top.html m.mid.html m.arc.html m.bot.html/) {
open $FILE,,$root/$_;
my @tmp = $FILE;
@doc = (@doc,@tmp);
close $FILE;
}
yitzle wrote:
`cat m.top.html m.mid.html m.arc.html m.bot.html blah`
How can this be done without a system call?
Here's my first guess:
@doc = ();
for (qw/m.top.html m.mid.html m.arc.html m.bot.html/) {
open $FILE,,$root/$_;
my @tmp = $FILE;
@doc = (@doc,@tmp);
close $FILE;
}
yitzle wrote:
`cat m.top.html m.mid.html m.arc.html m.bot.html blah`
How can this be done without a system call?
Here's my first guess:
use warnings;
use strict;
@doc = ();
my @doc;
for (qw/m.top.html m.mid.html m.arc.html m.bot.html/) {
open $FILE,,$root/$_;
Where is $root
yitzle wrote:
`cat m.top.html m.mid.html m.arc.html m.bot.html blah`
How can this be done without a system call?
As a general rule, if your script contains 'system()' anywhere in it, you've
done it wrong. This is especially true for simple file operations such as
the above, and for anything
Seanie wrote:
yitzle wrote:
`cat m.top.html m.mid.html m.arc.html m.bot.html blah`
How can this be done without a system call?
As a general rule, if your script contains 'system()' anywhere in it, you've
done it wrong. This is especially true for simple file operations such as
the above,
John W. Krahn wrote:
Your syntax for the open() statements is a bit dodgy too :-)
Perl defines the syntax so you must mean something else? :-)
As in too much unnecessary typing and commas and such, which don't really
add clarity, rather than incorrect
You should also include the $! or $^E
Seanie wrote:
John W. Krahn wrote:
Your syntax for the open() statements is a bit dodgy too :-)
Perl defines the syntax so you must mean something else? :-)
As in too much unnecessary typing and commas and such, which don't really
add clarity, rather than incorrect
The OP's open