Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
go ahead... be a heretic
 
PerlMonks  

Re: dynamic filenames, indirect filehandles

by rupesh (Hermit)
on May 19, 2005 at 00:07 UTC ( [id://458509]=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 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.

Replies are listed 'Best First'.
Re^2: dynamic filenames, indirect filehandles
by jjohhn (Scribe) on May 19, 2005 at 00: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 00: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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://458509]
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.