Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
Keep It Simple, Stupid
 
PerlMonks  

Re: dynamic filenames, indirect filehandles

by rupesh (Hermit)
on May 19, 2005 at 04:07 UTC ( #458509=note: print w/ replies, xml ) Need Help??


in reply to dynamic filenames, indirect filehandles

IMHO, I'm not sure what you're trying to achieve here, but here are a few pointers:

  • Always  use strict;
  • Why confuse yourself with the ARGuments? Why not use $ARGV[0], $ARGV[1]..etc?
  • open FH, '<', '<path of file>';
  • Why are you appending a file handle ($outfile)with  $sl ?
  • Indent


Update:Use split;

Cheers,
Rupesh.


Comment on Re: dynamic filenames, indirect filehandles
Select or Download Code
Re^2: dynamic filenames, indirect filehandles
by jjohhn (Scribe) on May 19, 2005 at 04:19 UTC
    Thanks rupesh
    I don't mean to append the filehandle, I mean to append the name ("path") of the file. Incrementing the name is just what I want to achieve. This is the core of my question: For a 20,000 line $readfile, I want to produce 20 separate $outfiles, files, named (for example) "outa", "outb", etc.
Re^2: dynamic filenames, indirect filehandles
by TheStudent (Scribe) on May 19, 2005 at 04:33 UTC
    Why are you appending a file handle ($outfile)with $sl ?

    So that he can say $outfile++ and generate unique file names for each split file.

    Lou

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://458509]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2014-04-16 10:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (423 votes), past polls