CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner:
Simple perl prob...


New User

Dec 8, 2010, 6:00 AM

Post #1 of 3 (2394 views)
Simple perl prob... Can't Post

Hello guys!
New kid in town needs help.
How can i display a part, per example 15 characters, of a file??


Dec 8, 2010, 9:23 AM

Post #2 of 3 (2383 views)
Re: [2wheeler] Simple perl prob... [In reply to] Can't Post

perldoc perlopentut
perldoc -f open
perldoc perlop and search for /I\/O Operators/
perldoc -f close
perldoc -f substr


I love Perl; it's the only language where you can bless your thingy.

Perl documentation is available at The list of standard modules and pragmatics is available in perlmodlib.

Get Markup Help. Please note the markup tag of "code".


Dec 9, 2010, 1:56 AM

Post #3 of 3 (2376 views)
Re: [2wheeler] Simple perl prob... [In reply to] Can't Post

If the file is "reasonably" small and a text file, read it in slurp mode ( and use substr to extract the 15 characters you are interested in.

An alternative is to open the file and use seek to position the file pointer to a specific position, and start reading from there the next 15 bytes using sysread.


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives