#perl - Fri 16 Mar 2007 between 04:19 and 04:46



phroggywhat exactly do you not want to change?
blarneyphroggy: it's OK, I have a solution that works for me
phroggy: "BEGIN { unless (eval "use Bazz::Foobar") { #warn "couldn't load Bazz::Foobar, try Foobar: $@"; use Foobar; } }"
phroggy: better "BEGIN { unless (eval "use Bazz::Foobar") { use Foobar; } }"
phroggybut isn't Bazz::Foobar buggy?
I'm pretty sure that won't work the way you expect; you need to use "require" instead of "use"
blarneyphroggy: well, actually for people who have the system version setup have already overwritten the system one with the corrected version, so there's really only 2 cases
phroggy: seemed to work ok for me
phroggyblarney: I'm not sure the "use" will happen when you think it will.
I'm not entirely sure though.
I don't really know what happens when you call "use" inside a BEGIN block.
blarneyphroggy: there's an example at: http://www.unix.org.ua/orelly/perl/cookbook/ch12_03.htm
phroggyum, no there isn't.
BinGOsblarney: the pasting of links to warez sites is not appreciated.
Jmax-Ukraine--
blarneyBinGOs: I did not know it was, actually I thought it was an Australian unix user group when I first looked at, sorry 'bout that
overriderugh, you should get canned for that
blarney.ua vs .au ;)
it was just a random Google hit
somianYo yodleyou, BinGOs , howzzit
actionCPAN upload: Makefile-Parser-0.17 by AGENT
CPANupload: Makefile-Parser-0.17 by AGENT
blarneyphroggy: yep, you're right "require" works, but "use" will load both packages twice if they are present
phroggyI'm fairly confident that "use" is a bad idea.
(in this particular situation, I mean)
(when you're trying to do it conditionally)
blarneyphroggy: it loads them twice, presumably because "use" statements are scanned at compile-time
phroggythat's what I would expect, yes.
blarneyphroggy: and that's what happens
phroggythe second "use" happens at compile time regardless of the condition, then the first one (inside the eval block) happens later
blarneyphroggy: right
on a totally different subject, is there a way with Build.PL to prevent the download of modules via CPAN?
phroggyhuh?
actionsomian continues to hide in #rxvt-unicode
somiancontinues to hide in #rxvt-unicode
blarneyphroggy: I'm building a package for Fedora which must not do any downloads (i.e. it should build locally)
rhizoblarney: read perldoc Module::Build::Cookbook
blarneyrhizo: I did so, but I didn't see an option for that, somebody on #fedora-devel said that he thought there was one
|rellis|I'm trying to write a simple script to verify a user/password against local unix password database. i was looking at using getpwent but i was wondering if there's an easier way?
phroggy|rellis|: nope, although you can use getpwnam instead of getpwent
actionCPAN upload: Test-TAP-HTMLMatrix-0.08 by GAAL
CPANupload: Test-TAP-HTMLMatrix-0.08 by GAAL
phroggyyou need root access, and you'll have to call crypt() yourself.

Page: 4 11 18 25 32 39 46 53 60 67 74 81 88 95 102 

IrcArchive