> Hi Everybdy,
> I am stuck in a problem for which I need your help. My
> problem spins around adding an element in an array
> within a hash.
> I have a hash declared as $hash{"1"[EMAIL PROTECTED]; now I
> want to add an element to it within a loop. How would
> I do this? I would be highly gratefu
> Name "main::FH" used only once: possible typo at t.pl line 6.
It's because it's used only once ;o) . If you just declare something (variable,
filehandle etc.) but don't use it, something's probably wrong with your code (such as
a typo). If you try reading or writing using that filehandle the e
> Hi to all,
>
> I'm having bad times trying to solve this problem.
>
> I've to read from a Webserver-logfile some text indicating what page have been
> visited, and
> tracking the querystring parameters.
>
> The problem is that in the logfile special chars are traslated in "web safe" format
>
> How do i include a shell script in perl. I have to use some shell scripts in
> a perl script. I know I can write it in perl, but would like avoid doing it
> at this time, due to shortage of some time.
You could execute them as you would any other program. This example uses backticks:
`bob.sh`
> SORRY! copy-and-paste-error...I tried it without the ### ;-)
> and tried too the print-statement-thing.
> Seems the regex is wrong, but why?
> Jane
Try:
/^SA.+\n/
This email has been scanned for all viruses by the Message
> Two questions:
> I've got a test-file and want to add something to some lines, while
> reading it out.
> I tried the following code:
>
> while () {
> if (/pattern/) {
> #$line = $_ . $something;
> #push (@new_array, $line);
> }
> else {
> #$line
> Hi,
>
> Are there 'aliases' in perl? For example, if I have a Korn shell script and
> a function named "increaseCost()", I can do this: "alias
> decreaseCose=increaseCost" (passing a parameter in). of course this is a
> simplified example of what I want to do, but the point is to make > it
Alright then,
first you want to think about how you are going to populate the arrays. For example,
if I have a file that contains the following data:
1|10
5|7
I would do this:
open(FH, "< bob.txt");
my @file_list;
while()
{
# add a reference of the 2 file columns to @file_list
> How do I read data out of a table-file in an array-of-arrays?
>
> Problem: I have to compare two tables with pairs of start-stop-Positions.
> I want to find out, which pair of Start-Stop-Position in table_1 > is
> entirely within the range marked by a pair of start-stop-positions of
> the seco
> Hi if i have an string lets say
> $stri="Joana Prado";
> How do i transformm it into
> "joana prado"
> (all lowercase)
> Thanks
The lc function returns the lower case of a string:
my $lower_case_string = lc($stri);
This e
> Hi EVERYBODY,
Hi Dr Nick
>
> i saw this "-d" switch in an "if" statement.
>
> if (-d $file)
>
> What does it mean, and are there more
> this kind of switches and where can I find information about them.
This will return 'true' is $file contains the location of a directory. More
informa
Oh, it all makes sense now. what are you going on about man?
> Hi,
>
>
> my $line = ;
> chomp $line;
>
> my $first_space = index($line , " ");
>
> my $a = substr($line, 0, $first_space);
>
>
>
> my $last_space = rindex($line , " ");
> my $b = substr($line, $last_space+1);
>
>
>
>
There are loads of ways of doing this (Perl being what it is), but to help
you with the grep, how did you call it within Perl?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> When I am in a black command.com screen with CPAN> prompt, where am I? Why
can't I cd to c:\?
Because you're in the CPAN shell. You can ues this to download and install CPAN Perl
modules. If you type:
install Email::Find
You can go back to the command prompt by typing 'exit' and get help by t
> If ppm doesn't work, try 'perl -MCPAN -s shell'.
Oops, it's 'perl -MCPAN -e shell'.
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
s
Hi,
it's 'Email::Find'. You can get information on this from:
http://search.cpan.org/author/MIYAGAWA/Email-Find-0.09/lib/Email/Find.pm
If ppm doesn't work, try 'perl -MCPAN -s shell'.
Cheers!
-Original Message-
From: Dillon, John [mailto:[EMAIL PROTECTED]
Sent: 25 September 2003 11:24
To
> Why should it? Desktops are for the least sophisticated users, only.
Ooh, handbags!
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
Hi,
you need to give it some code to compile. Create a plain text file and put some code
into it, for example:
print "hello\n";
Save it somewhere. Then on the command line (the DOS thingy), cd to where you made
this file and type:
perl myperlscript.pl
Where 'myperlscript.pl' is the name you'v
> Is there a test I can do to determine the type of reference that has
> been created?
>
> ie. array of arrays, array of hashes, hash of hashes.
>
> I'm in a position where I didn't created the reference but still need to
> access it.
>
Howdy,
'ref' function will return will return what you wan
Afternoon,
you could use Term::ReadKey, for example:
use Term::ReadKey;
# if you hit ctrl-c you still want to return to 'normal'
$SIG{INT} = sub{ReadMode('normal')};
ReadMode('cbreak');
# 'ord' returns the ASCII value of a character
# and 27 is th
> $SIG{ALRM} = {
> `this-script`;
> exit;
> };
Sorry, didn't think it through (before anybody notices.). Remove the
thing that executes the script (the bit in backticks) and just have the
process start on a cron job.
Tired, apologies.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
Hi,
you could write a handler for the signal alarm that starts a new process and
kills the current:
$SIG{ALRM} = {
`this-script`;
exit;
};
At the beginning of the script set the alarm to go off 24 hours later:
alarm(84600);
DISCLAIMER: haven't really thought it through and it's really hac
Two dimensional hash perhaps? Where the first column is the first dimension and the
second is, well, the second.
E.g.
while()
{
($col1, $col2) = split(/$delimeter/, chomp($_));
$blah{$col1}{$col2} = 1;
}
Hope this helps.
_
> for(split(/(..)/, $string)) { print "*$_" if $_; }
Gorgeous :o)
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
you can use split for this sort of thing. For example:
my $string = "hello there";
# add an extra '.' for every character you want
my @pairs = split(/(..)/, $string);
The only thing you want to be careful about is empty quotes/nothing (e.g. ''). For
example, if we wanted to print the charac
You could try SpamAssassin (www.spamassassin.org). Quite effective rule based blocking.
A lot (if not most) Spam emails come from real email addresses, they just don't belong
to the guy that sent the email. For the Spammers that use their own email addresses
(be it Yahoo or Hotmail etc.), if you
26 matches
Mail list logo