rhash, when you're talking about me removing a lot of inapropriate text, you must be talking about the first .* (the one before somestring).
I thought the same as you, but preferawk put it in coz he had it in his first regex that was working... so...
If it is not this that you're talking...
ok, here is an answer to both your questions:
to be able to recognise on more than one line, you have to use the /s modifier... it looks stupid, but it's like this!
$contents =~ s/.*somestring.* ;//sg;
For your second question, you have to use a NON-GREEDY operator so it will only match what...
I'm sorry, but we don't have enough information with what you send us...
But I would say that:
$in{to} correspond to the fourth input tag. It has 'april' as a value.
if($alias{$in{to}}) tests if there is a value corresponding to $in{to} ('april') in the $alias varible (the %alias hash to be...
euh... yes! great idea! :)
but I'm in a very theoretical mood... I've just writen a 2000 lines program on paper... I'll start typing soon! lol!
Thanks anyway.
OK...
In the same idea... if I want to add a new array in a hash... can I use the same thing?
my %myHash ;
push(@myHash{anyArray}, "NEW ELEMENT") ;
And if it doesn't work (coz it seams not to work... I get a compilation error), how should I do something like this?
Thanks for your help.
A very simple question for you guys, expert of hashes:
Can I do that? (I mean... will it work?)
my %myHash ;
$myHast{toto}{tata} = "DID YOU SEE THIS?!" ;
print $myHast{toto}{tata} ;
#will this print 'DID YOU SEE THIS?' or do I have to initialise the hash in some other way?
Thanks for your help.
I think I saw something about knowing the size of an image some time before on this forum but...
I saw somewhere - maybe here... I can't remember - a way of knowing the size of an image without downloading the whole image (by downloading only the header of these).
Concretly... I give an URL of...
For you info... if you need to pring all the elements of an array... you don't need to do a foreach...
# THIS WORKS!
open(IN, "<myfile.txt") ; # '<' meaning "open for reading!"
my @tmpArray = <IN> ;
print @tmpArray ;
close(IN) ;
Just to complete everything that has been said!
Try:
if ($myString =~ m/^\w+$/i) {
#IF THE STRING IS ALPHA-NUMERIC
} else {
#IF THE STRING IS NOT ALPHA-NUMERIC
}
(this consider the character '_' being alphanumeric).
If you don't want this character:
if ($myString =~ m/^[a-zA-Z0-9]+$/i) {
#IF THE STRING IS ALPHA-NUMERIC
} else {...
I'm don't really know how to open for readding and writing at the same time... Usually, I used to open it in "append" mode and it was fine for me.
What I exactly want to do is:
Replace the $i line without altering the lines before and lines after.
If you have any simple way of doing so...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.