in reply to Opening external files with arguements

Sorry, I can't understand what you mean. Care to expand?

FWIW:

#!/usr/bin/perl use strict; use warnings; my $file=shift or die "Usage: $0 <file>"; open my $fh, $file or die $!; print scalar <$fh>; __END__
Can be used e.g. like thus:
$ ./foo.pl 'ls|' 449133.pl
(But then this is precisely the reason why I prefer the three args form of open() - there are situations in which you may want to do exactly the above, though!)

Replies are listed 'Best First'.
Re^2: Opening external files with arguements
by void_Anthony() (Acolyte) on Apr 28, 2005 at 15:42 UTC
    Three arguements form? Would you mind giving me a (simple) example?
      Three arguements form? Would you mind giving me a (simple) example?
      I must say i'm tempted to say: no! For I'm not here (and nobody is) to replace the best tool to answer this kind of questions, that is Perl's excellent documentation.

      However...

      open my $fh, '|-', "whatever" or die $!; # or open my $fh, '|-', "whatever", @more_args or die $!;
Re^2: Opening external files with arguements
by void_Anthony() (Acolyte) on Apr 28, 2005 at 15:36 UTC
    some code... open("specified file" arguements?) ^Quotes not included ^I don't know some more code...
      some code... open("specified file" arguements?) ^Quotes not included ^I don't know some more code...
      Huh?!? Is this supposed to be Perl?

      Have you tried open?

      What should these "arguements" you keep talking about be?