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

Re: Adding Pages

by Not_a_Number (Prior)
on Mar 19, 2014 at 21:06 UTC ( [id://1078990]=note: print w/replies, xml ) Need Help??


in reply to Adding Pages

Not quite sure what you're trying to do. It would be helpful if you supplied (a small but representative sample of) your input data, and the output that you would expect from this.

However, I can tell you that this line:

$. % $lines == 0 ? <> : print "\n";

is wrong.

First, since you have read the whole file into an array (@lines), and then you iterate over this array in a foreach loop, you can't use the input line number ($.).

Second, you use a variable $lines, which has not been initialised anywhere in your code. I imagine you mean $viewlines.

Update: Corrected typo (s/$!/$./;). Thanks Laurent_R.

Replies are listed 'Best First'.
Re^2: Adding Pages
by PilotinControl (Pilgrim) on Mar 19, 2014 at 21:27 UTC

    Hello Not_A_Number
    The sample input data would be this:

    Chevy Tahoe:Bob
    Ford Escape:Don
    Chevy Malibu:Chris

    Say I just want the first two lines and then page to the final line...of course there will be several input lines..the out put is I would like to page through the data instead of all the data show up in the console screen and have to scroll down to view everything. I hope I explained this thoroughly. Thanks in advance.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-19 13:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found