@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37



Comments:

<0> I'd heard the name mentioned.
<1> hobbs, i hoped some of those guys are in here ;) but thanks
<2> GumbyBRAIN: i'm in the mood for a california cheese burger
<3> Emailed her asking for is a mood.
<4> hello
<0> Hi
<4> i got a little question, i have an array of strings (some of them multiple times in the array) and i'd like to remove all duplicates
<5> eliteforce: perldoc -q duplicate
<6> Found How can I remove duplicate elements from a list or array? at http://perldoc.perl.org/perlfaq4.html;
<5> synie: If your system is ARM, you might find the packages from OE entirely suitable :)
<1> hobbs, it's a VIA machine. the flashcard is formated in fat32 ... so there should run the "normal" perl !?
<5> synie: you mean like a VIA C3 or one of those x86-compatible chips? Sure, you can build a lightweight perl on any x86 machine and copy it over, so long as you make sure to take care of issues like linking (your embedded system might use dietlibc or something)
<4> hobbs: thank you very much
<5> eliteforce: sure thing
<7> sigh



<7> ****ing export keeps failing
<7> stupid server won't respond
<4> one more thing, i want to fill an array with pathes of all files in a folder ('/bin', '/bin/cat', ...)
<7> irritating
<8> eliteforce: File::Find
<9> http://perlquestions.org/ powered by PHP ;-)
<7> File::Find::Iterator for l33tness
<10> how can i relax strict checking only in the scope of a sub?
<11> you dont ever want to do that
<10> i dont want to get warnings when i append an empty string
<11> all your code should be strict-compliant, or you **** badly
<11> then write your code correctly ;)
<11> my $new = $old ? $old : '';
<11> the ternary operator is your friend
<8> ghenry: oh well, that's because perl is for sysadmins and small utility scripts, who uses perl for the web in these modern times?
<4> sili_: File::Find::Iterator?
<8> ghenry: perl CGIs are so 1996
<9> zamolxes: :-)
<9> zamolxes: I hate seeing them mentioned. Catalyst+++
<2> GumbyBRAIN: perl needs iterators!
<3> Which actually turns us into many other needs.
<10> x86: '' wont give a warning if i append it to a string?
<10> x86: it does not count as empty?
<7> eliteforce: yes.
<12> stockholm: no warnings; $bad_code; use warnings;
<8> ghenry: indeed. good thing that site is not in the first 100 hits when googling 'perl questions' :)
<12> but. as x86 said, don't do that
<9> agreed zamolxes
<2> i've had (bad) reasons to do no strict; before
<11> stockholm: nope
<11> stockholm: '' is an empty string and can be used for that purpose;
<2> empty != undef
<10> cool, i had missed that.
<10> that is the best solution.
<13> fscking redhat.. if you're going to call an app 'rpmbuild', why call the package rpm-build!?!
<11> stockholm: of course you can always do: my $new = $old ? $old : undef;
<11> stockholm: but then you'll get errors when you try to use $new ;)
<7> $old || undef
<11> sili_: but that's less-leet ;)
<7> lies
<2> dec: because hyphens are cool, so is renaming everything!
<13> simcop2387: NO, it's not!
<11> redhat blows ;)
<5> donkey ****
<14> any idea how i can turn "2006-04-08 18:40:03" into epoch?
<13> x86: yes! they do! they blow goats frequently!
<10> x86: my ($var_list_r, $template, $hash_r, $from || '', $to || '') = @_;
<5> stockholm: that sounds dangerous
<10> hobbs: why?
<5> eval: $from | '' = 42;
<6> hobbs: Error: Can't modify bitwise or (|) in scalar ***ignment at (eval 141) line 15, at EOF
<5> eval: $from || '' = 42;
<6> hobbs: Error: Can't modify logical or (||) in scalar ***ignment at (eval 141) line 15, at EOF
<5> stockholm: the whole thing is pretty much illegal
<4> what lib do i have to install for file::find::iterator on debian?
<15> eval: $from or '' = 42;
<6> yango: Error: Can't modify constant item in scalar ***ignment at (eval 141) line 15, at EOF



<7> that was disturbing
<7> network connection died; solved by reboot... logs don't say anything useful
<7> although i didn't have to manually fsck on boot
<11> eliteforce: perl -MCPAN -e shell
<15> eval: $from = 40 or '';
<6> yango: 40
<11> eliteforce: once in the CPAN shell, install File::Find::Iterator
<2> hobbs: try this
<2> eval: 1 ? $a : $b = 42; [$a, $b];
<6> simcop2387: [42,undef]
<2> eval: 0 ? $a : $b = 42; [$a, $b];
<6> simcop2387: [undef,42]
<10> eval: $from = $from ? $from : '';
<6> stockholm:
<10> eval: $from="blah";$from = $from ? $from : '';
<6> stockholm: blah
<4> x86: how can i install it system-wide?
<10> as root?
<2> stockholm: the safest way is, $from = '' unless defined $from;
<10> simcop2387: why is that saver? it is more readable then the ? thing
<16> "Avochelm" at 203.122.248.254 pasted "hash of dbi objects not working" (48 lines, 2.2K) at http://sial.org/pbot/18372
<2> its easy to forget the order of the ? if you don't use it alot and it can be shorter
<2> actually the easiest to read is, $from = '' if !defined $from;
<11> eliteforce: general rule of thumb, DO NOT use your distro's package management system to install / update Perl modules
<4> x86: why? always worked perfect
<2> eliteforce: outdated, and cpan clobbers older versions when needed, ruining the package system
<10> x86: debian does just fine.
<11> eliteforce: it skips tests, installs old versions, etc, etc
<11> stockholm: no
<11> stockholm: no distro does ;)
<10> x86: i guess cpan could be a bit smarter and warn about parallel versions
<17> gday, i've got a hash of dbi prepare statement handlers and i'm trying to access it so that i can select the needed query from the hash. my implementation doesn't seem to work. any suggestions? (http://sial.org/pbot/18372)
<2> x86: i've long though of setting up CPAN by default for gentoo and creating an ecl*** that handles that automagically through cpan, that way any package can depend on a perl module
<11> if you only use cpan, you'll not have to worry about parallel versions ;)
<10> x86: lots of stuff on cpan is broken
<11> simcop2387: that'd be hawt
<2> stockholm: stop your blasphemy, you don't know how to use CPAN then
<10> x86: the distro does quality managent for you
<10> lol
<2> stockholm: i'm not joking
<11> stockholm: you're fighting a battle you will not win
<11> stockholm: ever
<11> ;)
<10> not in this channel. (c:
<18> I'm trying to use perl to determine the working directory of a bash script. Would someone please kindly point me in the right direction?
<2> x86: the biggest problem is i'd have to depreciate dev-perl/* packages
<2> [Shiba]: how does perl know about bash?
<18> if I call perl with -e, FindBin locates the running $CWD, not the calling script's $0
<18> I'm hoping to find a way to p*** a local variable $0 to perl
<2> use an environment variable, or a command line option to your script
<2> the second is safer
<11> [Shiba]: export ME=$0; exec /path/to/perl/script
<11> [Shiba]: my $bash_script = $ENV{ME};
<11> [Shiba]: arguments are always better, as simcop2387 said
<18> i.e. calling perl -e from inside a bash script to determine the script's directory
<18> yes I can use $ENV, but that determines the running $PWD
<18> not the script's $0
<2> well i need sleep
<18> the point is htat I want to locate the script's direcory so I can reference local files within
<18> I can't write a C program, since I don't know where to execute it
<18> but perl is on the path of almost every unix machine
<2> [Shiba]: i believe that can be done in bash alone, #bash might help
<18> something like getcwd(), but that takes an argument that can be p***ed from a script
<18> ahh okay
<2> no need for perl at all
<18> thanks ;)
<19> [Shiba], gcc your_file.c; ./a,out<Enter>
<18> yes I know
<18> but the file's directory isn't in the path
<18> and I don't haev a way of determining where the script may be located
<18> the whole point of this is that I need to determine the directory name of hte script so I can address files local to the script :)
<2> [Shiba]: ask #bash how to get the CWD in a bash script, should be relatively simple
<2> or use relative paths


Name:

Comments:

Please enter the result of the sum 63 + 46 (to avoid spam):






Return to #perl
or
Go to some related logs:

#linux
#bash
rails insert-id
#web
#php
ubuntu cyberblade xp driver
Error: Caching enabled and local cache: livna not match checksum
Detect negative sign in field SQL
#bash
#mysql



Home  |  disclaimer  |  contact  |  submit quotes