Talk About Network



Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Perl Beginners > perl head and t...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 5 Topic 10999 of 11065
Post > Topic >>

perl head and tail command ?

by rich.japh@[EMAIL PROTECTED] (Richard Lee) Apr 28, 2008 at 01:31 PM

I would imagine linux's head command can be replaced w/ chop
I asked this because I have a filehandle which was,

open $source, '/tmp/server.txt'   ( and no doing head -1 /tmp/server.txt 
is not an option since I need to go through some other stuff
before i need to issue below command )

and I wanted to do

my $top = `head -1 $source`
my $bottom = `tail -1 $source`

but I realized I cannot do $source in back tick.

so I imagine i can do

my $top = chop $source;

But what about the $bottom one?




 5 Posts in Topic:
perl head and tail command ?
rich.japh@[EMAIL PROTECTE  2008-04-28 13:31:22 
Re: perl head and tail command ?
rob.dixon@[EMAIL PROTECTE  2008-04-28 18:56:06 
Re: perl head and tail command ?
rob.dixon@[EMAIL PROTECTE  2008-04-28 19:12:39 
Re: perl head and tail command ?
noreply@[EMAIL PROTECTED]  2008-04-28 20:40:04 
Re: perl head and tail command ?
rich.japh@[EMAIL PROTECTE  2008-04-28 14:04:17 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed May 14 15:06:31 CDT 2008.