Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: How to Put a Loop in my 1st Program

by c-era (Curate)
on Nov 21, 2001 at 19:28 UTC ( #126777=note: print w/replies, xml ) Need Help??


in reply to How to Put a Loop in my 1st Program

You want to use a while loop,
#!/usr/local/bin/perl open (TEXT,"general.txt") || die "Could not open file: $! \n"; $addthis=join("", <TEXT>); close (TEXT); open (FILES,"files.txt") || die "Could not open file: $! \n"; # Start to loop here??? or after the next group of statements? while ($line=<FILES>){ chomp $line; open (DATA,"$line") || die "Could not open file: $! \n"; $tothis=join("", <DATA>); close (DATA); $newrecord=$addthis.$tothis; open (DATA,">$line") || die "Could not write to: $! \n"; print "$line\n"; print DATA $newrecord; close (DATA); }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2022-01-27 15:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (70 votes). Check out past polls.

    Notices?