Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: splitting up a long text at regular intervals

by EvanCarroll (Chaplain)
on Oct 30, 2005 at 23:25 UTC ( [id://504076]=note: print w/replies, xml ) Need Help??


in reply to splitting up a long text at regular intervals

I'm not sure as to what exactly your asking, but allow me to point you into the direction of unless ($. % 15) {}


Evan Carroll
www.EvanCarroll.com

Replies are listed 'Best First'.
Re^2: splitting up a long text at regular intervals
by pg (Canon) on Oct 30, 2005 at 23:43 UTC

    $. is error prone, as one can have multiple files open in a program, but there is only one $. I would rather call input_line_number() with specific file handler.

    use IO::Handle; open(MYSELF1, "<", "test.pl"); open(MYSELF2, "<", "test.pl"); while (<MYSELF1>) { print "after reading from myself1: $.\n"; if ($. % 2) { <MYSELF2>; print "after reading from myself2: $.\n"; } print "returned values from input_line_number: ("; print MYSELF1->input_line_number(), ", "; print MYSELF2->input_line_number(), ")\n"; } close(MYSELF1); close(MYSELF2);

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2024-04-23 22:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found