Beefy Boxes and Bandwidth Generously Provided by pair Networks Cowboy Neal with Hat
Perl: the Markov chain saw
 
PerlMonks  

Re: Opening external files with arguements

by blazar (Canon)
on Apr 28, 2005 at 11:32 UTC ( [id://452345]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


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 11: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?

Re^2: Opening external files with arguements
by void_Anthony() (Acolyte) on Apr 28, 2005 at 11: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 $!;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://452345]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.