Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Usage of a sparse file

by mishikal (Novice)
on Mar 11, 2013 at 08:16 UTC ( #1022758=note: print w/ replies, xml ) Need Help??


in reply to Usage of a sparse file

I've found this works

my $total=`du --block-size=1 $line`; my $junk; chomp($total); ($total,$junk)=split /\t/, $total, 2;
But I'd like to do it in perl rather than calling out to the shell.


Comment on Re: Usage of a sparse file
Download Code
Re^2: [OT]: Usage of a sparse file
by AnomalousMonk (Monsignor) on Mar 11, 2013 at 17:10 UTC

    Just a parenthetic note. If  $junk is something you don't care about at all, then you don't need to bother capturing it:

    >perl -wMstrict -le "my $total = qq{123\tasdfghhj\n}; print qq{[$total]]}; ;; ($total) = split /\t/, $total, 2; print qq{'$total'}; " [123 asdfghhj ]] '123'

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (8)
As of 2014-07-24 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (157 votes), past polls