Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

this one's a file utility

by da w00t (Sexton)
on May 11, 2000 at 11:56 UTC ( [id://11137]=obfuscated: print w/replies, xml ) Need Help??

#!/usr/bin/perl ($a,$b)=@ARGV;($c,$d)=split/[^\d]/,$a;if(!-f$b){die"$b $!\n";}else{ope +n (F,$b)||die"$b $!\n";seek(F,$c,0);$f=0;$e=$d-$c;while($f!=$e){$g=$e-$f +; if($g>=512){read(F,$h,512);$f+=512}else{read(F,$h,$g);$f+=$g}print$h;} +}

Replies are listed 'Best First'.
RE: this one's a file utility
by da w00t (Sexton) on May 11, 2000 at 12:00 UTC
    this takes 2 arguments ex: ./script 0-100 file
      Can you make it work with use strict?
        #!/usr/bin/perl use strict;my($a,$b)=@ARGV;my($c,$d)=split/[^\d]/,$a;if(!-f$b){die"$b +$!"}else {open(F,$b)||die"$b $!";seek(F,$c,0);my$f=0;my$e=$d-$c;my$h;while($f!= +$e){my$g =$e-$f;if($g>=512){read(F,$h,512);$f+=512}else{read(F,$h,$g);$f+=$g}pr +int$h;}}
        ;)

Log In?
Username:
Password:

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

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

    No recent polls found