@# Quotes DB     useful, funny, interesting





Google
 
Web www.quotesdb.info
Undernet  |  EFnet  |  Quakenet  |  Freenode  |  Dalnet  |  Ircnet  |  Galaxynet
Page: 1 2



Comments:

<0> is this legal?: if ( $mystring=~s/me/you/g eq $yourstring ) {blah}
<0> hello?
<1> hmm
<1> no idea
<1> I think substitute returns the number of matches replaced
<0> i seem to have a problem...I read a line from a file, put that in a string, then compare that with a string that I have already...but they ALWAYS come up negative when I do ($str2 eq $str1) .. any idea why that may be? i chomped them both too
<0> when I print them, they look the EXACT same
<1> newlines?
<1> tabs?
<1> any kind of whitespace might be in there
<0> is there a function that eats all that stuff?
<1> chomp()
<0> i don't so much care what it turns out as, I just care if they are equal or not
<0> yea, I did the chomp
<1> if ( $mystring=~s/me/you/g eq $yourstring ) {blah}
<1> is that part of the logic?



<1> I think that's wrong
<0> if (chomp($input1) ne chomp($input2) ) {
<0> is the exact thing I use
<0> no,its not part
<0> i do that able
<0> above
<1> does http://perldoc.perl.org/functions/chomp.html
<1> see what chomp() returns
<0> interesting
<0> total characters
<0> thats odd
<0> so I need to chomp on a diff line then, huh
<0> if I do just: chomp($string1); , it will actually modify string1 right?
<1> correct
<0> sweet, it worked...thanks a lot
<2> need help in perl file
<1> shoot
<2> one sec
<2> when i try to compile a perl file i get "Number found where operator expected"
<2> what that supposed to mean?
<3> Mosesdd: how could the error msg be any more clear?
<1> is there an "on line NNN" ?
<2> pizza milkshake, i will explain the problem.
<1> no explaining
<1> pastebin.ca it
<2> i'm not a programmer. i got this file from a friend which told me to compile it but due to this problem i can't compile it
<2> so i don't know what the problem means
<1> well, have your friend fix it
<2> lol.. he went abroad and i promised him i'll compile it until he returnes.
<2> can't someone give me a hand here?
<1> "compile it until he returns" lol
<1> There's a problem with the source code. We can't help if you can't deal with source code.
<2> can you look at the source code maybe and try to see what's the problem?
<2> i'm sure it's only a syntax thing
<2> not something serious
<1> bingo, pastebin.ca
<2> raizor?
<1> go there
<1> you should understand what to do when you get there
<1> you need to paste the source code of the script there
<1> and give us the URL
<1> it should be relatively self-explanatory and if not...well...we can't really help someone like that here
<0> how can I use the rm with perl? system("rm blah"); doesn't work
<2> http://pastebin.ca/39212
<1> cyclic: it's probably asking for confirmation, use `rm -f bla`
<1> cyclic: otherwise, see unlink()
<0> ill check it out, thanks
<0> how do the backticks work?
<1> they work like system()
<1> return the output
<0> so you just call flat out: `rm -rf /`; ?
<1> Mosesdd: paste the full error message
<1> cyclic: um...yeah
<0> :-D
<0> don't worry, im not writing a virus :-)
<1> #!/usr/bin/perl\n`ls -al`\n
<1> for example, that might be an entire script
<0> whats the \n for?
<0> you can do newline outside " " ?
<0> man, perl has such weak syntax!



<1> no, that was just to get it all on one line here
<2> http://pastebin.ca/39214
<1> this is ie_xp.pm? --> http://pastebin.ca/39212
<1> oh lol
<1> who wrote this?
<1> Microsoft Windows / Internet Explorer WMF (9day)
<1> Date : 28/12/2005
<1>
<1> Advisory ID : FrSIRT/ADV-2005-3086
<1> Rated as : Critical
<1> Note :
<1> ---
<1> all that needs to be in comments
<2> that's the only problem?
<1> maybe
<2> comments are marked like this: ## ?
<1> single # is fine
<2> one in the beginning of each line?
<1> correct
<2> let me try
<2> man!!!
<2> you deserve a miliion dollars!
<2> it's working!!
<2> thank you raizor
<1> paypal@redrival.com :)
<2> :)
<4> anyone know how to open a file and pick a random line out and save to a variable?
<5> sure
<4> how? :)
<5> open( my $fh, $ARGV[0] ) || die "Cannot open"; my @lines = <$fh>; close $fh; print $lines[int(rand(@lines))];
<5> instead of the print you save to var
<4> $fh=c:/mytext.txt; ?
<5> mno
<5> $ARGV[0] contains the path.
<4> so $ARGV[0]=c:/mytext.txt; works then?
<5> it should
<5> ( Though i would use a different variable-name )
<5> this one is rather special
<4> do i need the [0]?
<5> nope
<5> just call it $filename or something like that
<4> whats $fh?
<5> file handle.
<4> so i could name that one
<5> you can name variables basically what you want to call them... provided you only use A-Z, a-z, _ and 0-9
<5> ( and I think they can't start with a number )
<4> its soooo not working :(
<5> oh ?
<5> the line I gave you runs.
<4> found a solution :)
<4> http://pastebot.nd.edu/252?hl=on
<5> does that work?
<5> open with 3 params ?
<4> yeah it works great
<6> anyone awake?
<6> I used to know a thing or two about perl, but I seem to have lost my edge. I have a slight issue, and was hoping someone might help refresh my memory.
<1> shoot
<6> I have a test script that will return eseentially 2 values, ONLINE, and OFFLINE
<6> unfortunately, one of the alternatives is OFFLINE|FAULTED
<6> so I'm trying to remember how I write the test case to say is "OFFLINE" contained within the string $state
<1> if ( $state =~ /OFFLINE/ ) { bla; }
<6> I recall something about the binding operator... =~
<6> ' ah.
<6> slashes, not quotes?
<7> hm
<6> OH RIGHT, because we're using the m/ operator
<1> it's regex, not a string comparison
<6> Thanks bro. that's what I needed.
<7> you can use '$state =~ m"OFFLINE"' if you really want to use "
<7> But / is the only delimiter that works without the m
<8> I'd use the index function for that
<7> And if you use valid varname characters as your delimiter you need a whitespace
<4> sdffds


Name:

Comments:

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






Return to #perl
or
Go to some related logs:

ABIT BACHAN
#allnitecafe
#india
#allnitecafe
dalnet nobody talks
#worldchat
L G I S G O O
#chat-world
#india
bade dil waley



Home  |  disclaimer  |  contact  |  submit quotes