Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re^2: exports -- which module exports are used? ($.)

by tye (Sage)
on Oct 03, 2013 at 17:08 UTC ( #1056777=note: print w/replies, xml ) Need Help??

in reply to Re: exports -- which module exports are used?
in thread exports -- which module exports are used?

There is probably a better solution, and I suspect it has something to do with the seek.

Indeed. This is how I've fixed it:

$. = 0; seek $fh, 0, 0 or die "Can't rewind handle to $file: $!\n";

(Updated: Actually, you also have to move that code so that it gets run before 'print' (for example) gets called, which is required else $. would be tied to STDOUT.)

Alternately, you can do:

{ my $eof = <$fh>; $. = 0; } seek...

Or I could just open the file twice.

- tye        

Replies are listed 'Best First'.
Re^3: exports -- which module exports are used? ($.)
by toolic (Bishop) on Oct 03, 2013 at 17:24 UTC
    Thanks for the patch.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056777]
[stevieb]: Marshall: no. I commented on the thread yesterday. Visual Studio updates the tags ok, but corrupts the exe
[stevieb]: I advised the OP that a possible workaround would be to add a version function/flag that displays the required copyright/license info instead
[Marshall]: Darn! I'll look at the thread. Must not be updatinga byte count somewhere. The .exe format is a complex critter.
[stevieb]: that way, it's still "hard coded" into the exe at least, despite not being visible via Properties
[Marshall]: I also looked into PerlApp from Active State, but they don't sell their Dev Kit independent of a very expensive ($1,200) per year license anymore.
[Corion]: I would assume that the PE format hasn't changed that much since the days of yore, but it seems that I would be wrong in that assumption
[Marshall]: When I bought my copy 15+ years ago, it was just a couple hundred bucks.
[Marshall]: I looked at MS specs for PE format and I didn't see any changes in last decade, but evidenly that would be wrong.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2016-12-08 18:18 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (144 votes). Check out past polls.