Hi Octavian ,
I'm afraid that's how crypt() (the UNIX function) is. Here's an extract
from man crypt:
By taking the lowest 7 bits of each of the first eight
characters of the key, a 56-bit key is obtained. This
56-bit key is used to encrypt repeatedly a constant string
Hi,
if all you want to do is remove the '[*]' why not do:
s/^\[\*\]\s+//;
R
At 16:03 23/10/2002 -0800, Andres L. Figari wrote:
Hello,
I am having toruble getting my regex to work :^(
The file I'm parsing for headlines looks like this
[*] headline 1
[*] headline 2
etc ...
here is my perl
Hi,
You should think of a glob as an alias.
$input = *STDIN;
$file = $input;
print $file;
All that does is alias $input to STDIN, and then read the contents of
$input into $file. The main use of this is redirecting your output without
having to write loads of extra code
R
At 13:19
Hi Kurt,
You can save yourself the if statement. If the pattern is not found the
s/// will not proceed. That will save process ting the line twice when you
do match the pattern.
Other than that, you are changing nl followed by a single letter to pX
with X being a digit corresponding to that
Hi Javeed ,
the last element of the array is $attt[$#attt]. If you have one line per
element, that should do it.
R
At 14:24 04/10/2002 +0530, Javeed SAR wrote:
I have the following output in array @attt
I want the last line in a variable $out.
What should the regular expression be?
Hi,
not sure about the REMOTE_ADDR, I've never had any problems with it. To get
an IP from a URI try this:
use Socket;
$referral_address = $ENV{'HTTP_REFERER'};
$referral_address =~ m#^.*http://([^/]+)/.*$#;
$IP = inet_ntoa inet_aton $1;
If you want the IP address in hex, just use
Hi Eric,
if you want a more pretty way, (if a touch slower) try:
my @new_names = @old_names;
foreach (@new_names) { s/\.(jpg|gif)/\.html;i ; }
I personally don't like map as I came to PERL from C, but if you want to
use it instead...
my @new_names = @old_names;
map s/\.(jpg|gif)/\.html/i,
Hi Aman,
I've had exactly the same problem. I strongly suspect it's an IE thing.
I've not found a way round it other than looking at the HTTP_REFERER and
removing cookies from pages that had not come from my site.
R
-Original Message-
From: aman cgiperl [mailto:[EMAIL PROTECTED]]
Even simpler...
opendir DIR, /logs/test;
@dirs = readdir DIR;
closedir DIR;
foreach (@dirs) {
if ( -d /$_) {
# do your stuff
# Notice that you need to preceed the $_ with the path you
passed to opendir.
}
}
R
At 16:47 30/09/2002 -0500, eric
Hi Paul,
Ihashes would need a little bit of work to work with this, as you will have
multiple entries with the same key, eg you have three lines beginning 123.
if you have all you lines in an array, you could do this:
foreach $line (sort @arry) {
die Invalid input: $line\n unless ($line
Sounds like a mod_perl problem. If you are using Apache::Registry apache
will compile your script once and just keep running it until the child
process dies. This means that any global variables you pass to it will stay
in scope.
How is your script being called?
R
At 17:45 30/09/2002 +0200,
Hi Bruno,
The reason you could not open it properly is that Sendmail changed the
hashing algorithm it uses some time back. Have a look at man makemap to see
how Sendmail does it. PERL can read the Sendmail hash tables if you save
them in the right format
R
At 16:22 27/09/2002 -0300, Bruno
Here's a simple version...
$a = 5;
while ($a) {
foreach (1..10) {
if ($_ == $a) {
$exit++;
}
}
last if ($exit);
}
print \$a is $a\n;
R
At 20:20 27/09/2002 -0700, Michael Kelly wrote:
On Fri, Sep 27, 2002 at 08:29:53PM -0500, Grant Hansen wrote:
There are two easy ways...
If your file creates a lock file when it starts and removes it when it
finishes, a chec to see if the file exists will tell you if the script is
already running./
On linux / unix systems do a ps and looks for any occurrances of your
script name. If there are more
Hi Ken,
the reason you lose your data is simple. You have something of the form:
$myscalar = A weird hested hash;
you then try to add an entry by doing:
$myscalar = Some other data;
What you look at it like that, it's clear what is going wrong. What you
want is:
on a linux / unix box:
alias perldoc='perldoc -U'
R
-Original Message-
From: Ramprasad A Padmanabhan [mailto:[EMAIL PROTECTED]]
Sent: 25 September 2002 11:01
To: [EMAIL PROTECTED]
Subject: perldoc as root
Cant I tweak perldoc so that it allows me to run as root Everytime I
want to
Hi,
how about:
while(@results = $dbh-dbnextrow){
print TR;
foreach (@results) {
print TD$_/TD\n;
}
print /TR;
}
R
At 08:19 24/09/2002 -0700, loan tran wrote:
Hi,
I codes in the while loop is too long. Can it be
written in different way?
want the input to be
given in quotes (that is from command line).
Script has to accept it without quotes.
I want to make changes in script.
my script is as follows:
my ($str1, $str2,$lb1,$comment) = @ARGV;
-Original Message-
From: Robin Cragg
[mailto:[EMAIL PROTECTED]mailto:[EMAIL
Hi Pual,
I think this will do the trick...
$MAXSIZE = 500
$size = 0;
@Zip_Now = ();
foreach (@Files_to_zip) {
$size += (stat $_)[7];
if ($size $MAXSIZE) {
exec tar -vr -T @Zip_Now -f $tar_file;
# then burn this to CD
this to CD
@Zip_Now = ();
$a++;
}
push (@Zip_Now, $_;
}
exec tar -vr -T @Zip_Now -f $tar_file;
-Original Message-
From: Robin Cragg [mailto:[EMAIL PROTECTED]]
Sent: 22 September 2002 12:17
To: 'Paul Tremblay'; [EMAIL PROTECTED]
Subject: RE
How about..
if(/\[(\d+\.\d+\.\d+\.\d+)\].+reject=550/) {
$IP{$1}++;
}
the your array of unique IPs is just keys %IP
R
At 14:14 20/09/2002 +0100, Griggs Rob wrote:
Hi All,
Whats the easiest way to remove duplicate entries from an array. Below is a
script that removes ip
Hi,
we use netsint now, but before that we had a massive PERL driven forked system.
The basic flow of the program was:
read in data from mySQL table into an array
foreach $test (@tests) {
if ($pid = fork) {
# this is the parent process
# we just wait
Hi,
if you're a C programmer, then you use make with decent sized projects, I
assume? If so, keep all your little source scaps in files with a particular
suffix and then use make...
SUFFIX = .pl.bit
TARGET = myprog.pl
all:
@cat *${SUFFIX} ${TARGET }
That will work fine, but
Hi Mark,
given how small your data chunk is, you can do it any way you'd like.
Here's a chunk that works ..
(Query_Database() just returns an array where each element contains an
array ref to all the elements of that column.)
@History = Query_Database(SELECT
24 matches
Mail list logo