Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^6: Use module only if it is in use

by vitoco (Friar)
on Sep 02, 2009 at 16:33 UTC ( #792961=note: print w/replies, xml ) Need Help??


in reply to Re^5: Use module only if it is in use
in thread Use a module only if it is in use

Shouldn't that have a relevant overhead when used as:

while ($line = <F>) { chomp($line); $line = rarely_called($line) if $asciify; ... }

BTW, I did something like that (using eval), but checking a flag to require the module only in the first call.

Replies are listed 'Best First'.
Re^7: Use module only if it is in use
by ikegami (Pope) on Sep 02, 2009 at 16:45 UTC
    Benchmark and find out. Or use the self-loading alternative. Or split the initialisation from the actual use.
    require Text::Unidecode if $asciify; while ($line = <F>) { chomp($line); $line = Text::Unidecode::unidecode($line) if $asciify; ... }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://792961]
help
Chatterbox?
[Corion]: I see the Chuwi H9 Air, but at the price of 8 or 9 cheapo tablets, that
[Corion]: ... that's not that great for quasi-disposable devices ;)
[Eily]: can't you just remote connect to the linux machine ?
[marto]: IIRC the hiemdal suite made life much easier on windows, and people on XDA developers put out released of windows only pages for adb that made it less of a pain
[marto]: Eily you can't remote connect the physical device via USB ;)
[Corion]: Eily: Sure, that's what I do, but some things you need to do on the Android device directly, like when navigating the bootloader :-)
[Eily]: marto you just need a longer cable :P
[Corion]: marto: Yeah, but I'm somewhat wary of installing random USB drivers downloaded from mega.nz , Google Drive or whatever, so Linux wins there due to there being no conflicts and me just having to edit one text file in the worst case, to add the USB vendor
[hippo]: Long USB cable FTW.
[Corion]: Eily: I've thought of that, but I don't like running long cables through the appartment because sooner or later I'll trip over it, pulling at least one device off its stand :)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (10)
As of 2018-05-23 09:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?