Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

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

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, "<", ""); open(MYSELF2, "<", ""); 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?

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-05-22 04:21 GMT
Find Nodes?
    Voting Booth?

    No recent polls found