Title: RE: -d test file
I've found. I have to put the absolute path.
Is there a way without absolute path ?
Franck
-Message d'origine-
De : COLLINEAU Franck FTRD/DMI
[mailto:[EMAIL PROTECTED]]
Envoyé : mardi 22 janvier 2002 08:15
À : [EMAIL PROTECTED]
Objet : -d test file
Greeti
Greetings,
I have the following code:
#!/usr/bin/perl -w
$chemin="/home/collineau/tests";
opendir (DIR,"$chemin") || die " impossible d'ouvrir le répertoire $chemin
$!";
while ($rep=readdir DIR)
{
print "$rep\n";
$a =-d $rep;
print "$a\n";
}
The output is:
..
1
...
1
T
hey,
u cud direct o/p of the script to a file...that u mail it to yourself
using some script...
something like
* * * * * script >> logfile 2>&1 &
in the end of the cron u cud get u r mailing script called in ...
this shud also take care of errors in the cron ( i mean the scrip
entered in th
Hello,
I am running crontab command.
I want the output of commands in crontab file to be mailed to me.
I am expecting the output that is printed out on terminal to be mailed to me...
For that I am setting the MAILTO environment variable at the beginning
of crontab file.
MAILTO=""
But it
Hello,
I am running crontab command.
I want the output of commands in crontab file to be mailed to me.
For that I am setting the MAILTO environment variable at the beginning
of crontab file.
MAILTO=""
But its not working though the commands in crontab file are working
fine.
Also, if I am
Hello,
I am running crontab command.
I want the output of commands in crontab file to be mailed to me.
For that I am setting the MAILTO environment variable at the beginning
of crontab file.
MAILTO=""
But its not working though the commands in crontab file are working
fine.
Also, if I am
$dbh = DBI->connect("dbi:mysql:world",
"username", "mypassword",
{ RaiseError => 1 } );
Hi, does connecting perl to a windows db differ from what?
like mysql it will connect using that example on top, sample only. k?
thanks,
louie...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additi
Two posts in one day; wowza.. anyhoo
I am making a cgi script that lets a user upload an image file,
and then from there - it resizes it - then spits the resized version out.
The thing is, I need to have unique file name generated for the resized
image file - so for example, say a user up
If your OS supports an SNMP agent, you might want to try SNMP-Monitor
module.
Good Luck,
Hamid.
-Original Message-
From: Andre' Solomon [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 21, 2002 10:08 PM
To: [EMAIL PROTECTED]
Subject: RE: Perl Module for Server Statistics
Hi,
I'm looki
Hi,
I'm looking for a Perl Module that would allow me to determine some basic server
statistics such as uptime, CPU usage per process, total CPU usage, disk usage, etc.
Can someone point me in the right direction please.
Thanks,
Andre'
- Original Message -
From: "maureen" <[EMAIL PROTECTED]>
To: "Leon" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, January 21, 2002 8:39 AM
Subject: Re: Array Problem
> if ($username ne /$in{username}/)
> {
Anything in between the forward slash are usually used as a regular
ex
Okay, I've got a little script that takes user passwords on a Win32
terminal client. I've used Term::ReadKey from the activestate module list
to turn off screen echo.
So it's something like
sub{
ReadMode 2; #turns off echo
Prompt for password;
Get password;
ReadMode 1; #should turn echo back on
}
Hi!
Is there a command in perl that refreshes the screen? Like the clear();
command in C or the CLS in DOS prompt or CLEAR in Unix.
I would like the script to clear the window when I run it. In so that it
would look more presentabel and info. would be more easy to spot.
Thanks!
--
To unsubsc
> the original regex that Gordon said "worked" was:
>
> : >> if ($line =~ m/.*\,.*\,.*\,.*\,.*\,.*/){
>
> which would match "," quite happily. perhaps in this
> application it's expected that there won't be anything
> between the commas...
if ($line =~ m/(?:[^,]+\,){5}[^,]+/)) {
should do
Hi all,
I'm just learning Perl and have been thrown into the fire so to speak. I have many
years of programming background but because of my limited experience with Perl and the
nature of the project I'm working on (wanting results quickly) I'm having some
questions that are probably pretty ob
Not the way you are thinking, but yeah, it can be done...
# Untested!
my %data;
foreach my $name ( param() ) {
# match the format, grab the data, and skip
# irrelevant form fields
$name =~ /^(\w+)_(\s+)$/;
my $type = $1;
my $num = $2;
next unless ( $type );
$data{$num}->{$type} = p
You'll need to have the ImageMagick libraries installed on your system, as
Image::Magick is just an api for them (almost certainly why your installs of
Image::Magick are breaking). I just installed this yesterday and am super impressed.
Very easy to use and faster than I thought. Only odd thing is
Check out the Image Magick page, it might help fix your problem. If you are
using ActivePerl you should get the entire package from ActiveState using
ppm, on Unix you need to install Image Magick then Perl Magick. Anyway,
here is the URL...
http://www.simplesystems.org/ImageMagick/www/perl.html
Awesome! is there anyway to do this using GD also? image magick wont seem
to install from CPAN - keeps returning bad make status.
Thanks again,
~Eric
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> -Original Message-
> From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 21, 2002 3:17 PM
> To: Bob Showalter
> Cc: 'Dean Theophilou'; Perl_beginner (E-mail)
> Subject: RE: The => in Hashes
>
>
> On Jan 21, Bob Showalter said:
>
> >=> only quotes a bareword th
Try Image::Magick.
use Image::Magick;
my $im = new Image::Magick();
$im->Read($inputfile);
$im->Resize( geometry => "200x200" );
$im->Write($outputfile);
undef $im;
Rob
-Original Message-
From: Eric [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 21, 2002 3:10 PM
To: [EMAIL PROTECTED
On Jan 21, Bob Showalter said:
>=> only quotes a bareword that is a legal identifier name, with
>an optional leading minus sign. Key1 in your example qualifies, so
>there is no need to quote it. Something like "First Name", or
>"123" doesn't qualify, so they need to be quoted.
123 does not requi
> -Original Message-
> From: Dean Theophilou [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 21, 2002 3:03 PM
> To: Perl_beginner (E-mail)
> Subject: RE: The => in Hashes
>
>
> Well, suppose we had this:
>
> %Day = (
> "Sun" => "Sunday",
> "Mon" => "Monday",
> );
>
> Wou
Hello all,
I have a directory of various .jpg and .gif files - and would like to
resize to them to a smaller size all at one time - is there a perl module
or any hints that could help me out? Thanks in advanced.
~Eric
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e
Well, suppose we had this:
%Day = (
"Sun" => "Sunday",
"Mon" => "Monday",
);
Wouldn't these keys be legal identifier names? And if so, then why quote them?
-Original Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 21, 2002 11:27 AM
To: 'Dea
As was pointed out before, it's probably difficult (if not impossible) to
have perl access an already open telnet session.
However, I have accomplished a similar task by using perl to copy to/from
the Windows clipboard (of course, this precludes that you're using Windows).
Here's the process (in
> -Original Message-
> From: Dean Theophilou [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 21, 2002 2:16 PM
> To: Perl_beginner (E-mail)
> Subject: The => in Hashes
>
>
> Hello:
>
> There have been many times that I have seen a hash like this:
>
> %Hash = ("Key1" => "Value1"
Hello:
There have been many times that I have seen a hash like this:
%Hash = ("Key1" => "Value1");
My question is that if the => operator quotes stuff to the left of it, then why
bother quoting the Key1 portion of the hash definition?
Also, what the !@#$!@# is "foo"! :)
Your format is exactly the way that I've done similar things, except for
putting another double quote after the abc (I assume that was just a typo
anyway). And make sure to use semicolons at the end of your statements
inside the if statement. But otherwise, I think you one way to do it
already.
Hi Walter,
You can use CPAN module Term::ReadKey:
use Term::ReadKey;
ReadMode('noecho');
$password = ReadLine(0);
I got this from O'Reilly's Perl Cookbook page 529 :)
-vicky
--- walter valenti <[EMAIL PROTECTED]> wrote:
> Hi,
> someone knows, how insert text gron STDIN, without
> see this on
I think this is what you wanted...
use CGI qw/:standard/;
# Loop over each field name in the form
foreach my $name ( param() ) {
# If the name starts with "ID_" ending with a number
if ( $name =~ /^ID_\d+$/ ) {
print "It's an ID! The value = " . param($name) . "";
}
# If the name st
Hi Anadi,
Hope this helps:
#!/tools/bin/perl -w
print "enter a number\n";
$a = ;
if ($a == 12 or $a== 8) {print "right\n";}
else {print "incorrect\n";}
#end of script
-vicky
--- A Taylor <[EMAIL PROTECTED]> wrote:
> Hi all,
> I am trying to test three variables in an 'if'
> statement eg:
>
Hello, I hope someone can help me. I am attempting to modify a perl
script that uses hashes and my problem is that I am trying to add hashes
values to the array $o_traffic_rec but I can't seem to reference the
value of the new hash.
The array is defined as $o_traffic_rec{hosts}{$var1}
I am tryi
Hi all,
I am trying to test three variables in an 'if' statement eg:
if ($a eq "abc and $b eq "efg" and $c eq "hi")
{
do some code .
}
how do i do this in perl
Thanks in advance
Anadi
_
Send and receive Hotmail on your
You could use CGI.pm.
use CGI qw/:standard/;
foreach my $name ( param ) {
# Skip everything except ID_# vars
next unless ( $name =~ /^ID_\d+$/ );
# Handle variable here
print "$name = ".param($name);
}
Is that what you were asking or did you want to pass the vars between pages?
If you n
From: "Alex Harris" <[EMAIL PROTECTED]>
> I need to place code that leaves my program entirely if certain errors
> occur (mostly on opening a file). However I don't want ANY messages
> going anywhere except my $errlog. (I noticed die, seem to always show
> a message at the comm
not by default that is.
I apologize for double posting, I've been warned that
my subject was too vague.
Hello everyone,
I hope someone can help me with this problem.
Here is what I am trying to do:
- Job request is entered in Form-A.
- When Form-A is submitted, apple.cgi tells the user
the fo
Thanks so much for your help on this. I tried this suggestion, but
unfortunately, the array @indata does not seem to contain the usernames
from the file pwdata.txt.
I've been looking at this for hours. I hope someone can help me figure
out what I am missing here. The objectives for this code and
Can someone please help me with the following:
I need to have variable names like ID_1, ID_2, ID_3 ...ID_n.
How can I read them on the next page after submitting through a FORM using
POST method?
thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTE
Hello everyone,
I hope someone can help me with this problem.
Here is what I am trying to do:
- Job request is entered in Form-A.
- When Form-A is submitted, apple.cgi tells the user
the form is successfully submitted and at the same
time appends the request into an html file
(banana.html) tha
Fantastic!
Thankyou.
From: Briac Pilpré [mailto:[EMAIL PROTECTED]]
Sent: 21 January 2002 16:05
To: [EMAIL PROTECTED]
Subject: Re: Using system variables (M$ OS's)
Andrew Mason wrote:
> I would like to print a line containing the value of a system variable
> (I'm running on M$ NT4).
#!/usr/bin/
On Jan 21, Mason, Andrew said:
>My system variable is %IPADDRESS%.
You can access that via $ENV{IPADDRESS} in your Perl program.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan.org/
** Look fo
Andrew Mason wrote:
> I would like to print a line containing the value of a system variable
> (I'm running on M$ NT4).
#!/usr/bin/perl -w
use strict;
print "Blah blah $ENV{IPADDRESS} blah!\n";
__END__
--
briac
<< dynamic .sig on strike, we apologize for the inconvenience >>
--
To unsubsc
I would like to print a line containing the value of a system variable
(I'm running on M$ NT4).
My system variable is %IPADDRESS%.
At the moment my code looks like
chomp ($IpAddress=`echo %IPADDRESS%`);
print "blah blah $IpAddress blah";
Is there a better/preferable way of doing this?
Cheers,
From: Babichev Dmitry <[EMAIL PROTECTED]>
> >> How i can change environment variables (e.g. PERLDB_OPTS) to any
> >> values so they remained general(public) for all instances of perl
> >> scripts?
>
> BS> Typically you accomplish this kind of thing by setting the
> variable i
On Jan 21, Franck Collineau said:
>#!/usr/bin/perl -w
>$chemin="/home/collineau/tests";
>opendir (DIR,"$chemin") || die " impossible d'ouvrir le répertoire $chemin
>$!";
>while ($rep=readdir DIR)
>{
> print "$rep\n";
> $a =-d $rep;
> print "$a\n";
>}
>Techmedia Broadband home
Greetings,
I have the following code:
#!/usr/bin/perl -w
$chemin="/home/collineau/tests";
opendir (DIR,"$chemin") || die " impossible d'ouvrir le répertoire $chemin
$!";
while ($rep=readdir DIR)
{
print "$rep\n";
$a =-d $rep;
print "$a\n";
}
The output is:
..
1
...
1
T
> -Original Message-
> From: Daniel Llewellyn [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 19, 2002 10:10 PM
> To: [EMAIL PROTECTED]
> Subject: LWP
>
>
> ok, looking through the archive - all the way down the 18000
> posts, I have
> worked out that LWP is my friend. However, I h
If you set the logging options of Exchange to the correct level, whenever a
user is sent a storage limit warning it will be recorded in the eventlog of
the mail server. This can then be extracted using Perl if you wish.
John
-Original Message-
From: Simon Rowan [mailto:[EMAIL PROTECTED]]
Ideally, I would like to log these to a file for reporting, so thought PERL
would be the best way of doing this.
THanks
Simon
-Original Message-
From: John Edwards [mailto:[EMAIL PROTECTED]]
Sent: 21 January 2002 13:07
To: 'Simon Rowan'; 'PERL beginners'
Subject: RE: Exchange mailbox si
> -Original Message-
> From: tom poe [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, January 19, 2002 11:48 PM
> To: [EMAIL PROTECTED]
> Subject: using force with cpan?
>
>
> Hi: I am running cpanv1.59, and with root.
>
> I notice that there are multiple failures at make install
> Won
Hmm.You've probably already got it all figured it out by now, however -
The message you report means the command processor cannot find perl.
What changed recently?
Did you type into the prompt exactly what you wrote below?
If so, try
C:\Perl\bin\perl.exe -w C:\Perl\eg\example.pl
rabs wrote
You can do this
die "\n";
The newline means die will not print anything out to STDOUT. (other than a
new line...)
HTH
John
-Original Message-
From: Alex Harris [mailto:[EMAIL PROTECTED]]
Sent: 21 January 2002 14:22
To: [EMAIL PROTECTED]
Subject: to die, croak, or confess
I need to p
I need to place code that leaves my program entirely if certain errors occur
(mostly on opening a file). However I don't want ANY messages going
anywhere except my $errlog. (I noticed die, seem to always show a message
at the command line). What's the best way to handle say the following th
On Jan 21, Alex Harris said:
>I need to place code that leaves my program entirely if certain errors occur
>(mostly on opening a file). However I don't want ANY messages going
>anywhere except my $errlog. (I noticed die, seem to always show a message
>at the command line). What's the best w
I need to place code that leaves my program entirely if certain errors occur
(mostly on opening a file). However I don't want ANY messages going
anywhere except my $errlog. (I noticed die, seem to always show a message
at the command line). What's the best way to handle say the following the
Does anybody know of a module that will return the total size of a users
Exchange 5.5 mailbox. I want to be able to give users who have large
mailboxes loads of automated grief !!
Cheers
___
Evolution is the investment banking and venture capital indu
> Can anyone explain the difference between my() and
> local() ?
Yes
> The manual says that I usually want to use my() but
> what exactly happens to a variable using local?
my() creates a brand new variable, which is undef unless
you specify otherwise. It is only visible within the
current lex
hi,
may be this would help...
http://perl.about.com/library/weekly/aa022801a.htm
ciao,
sachin balsekar.
Stefan Kredler wrote:
>can anyone explain the difference between my() and
>local() ?
>
>The manual says that I usually want to use my() but
>what exactly happens to a variable using local?
can anyone explain the difference between my() and
local() ?
The manual says that I usually want to use my() but
what exactly happens to a variable using local?
thanks for any advice.
greetings, stefan
__
Do You Yahoo!?
Send FREE video emails in
On Sat, Jan 19, 2002 at 04:23:38AM +, padu wrote:
> I am newbie at Perl.
[snip]
> Is it anyway possible to Extend the above program with
> constructors for rectangle and circle and a
> non-virtual function "move" to change the reference
> point of any of these objects.
>
> Can anybody help
From: <[EMAIL PROTECTED]>
> This might not be the right place for this question, but I trust this
> group.
>
> My boss wants me to create a mailing list from
> his MS ACCESS database. I am not an MS fun, but I cannot tell him this.
>
> So my question is how do I create labels
From: "Chris Zampese" <[EMAIL PROTECTED]>
To: "perl list" <[EMAIL PROTECTED]>
Subject:finishing a script
Date sent: Mon, 21 Jan 2002 10:31:10 +1300
> Hi All,
> Just needing help regarding ending a script properly. I have a
On Sat, Jan 19, 2002 at 11:40:14PM +0800, yun wrote:
> I found in perl samples many strange signs, I'm really
> confused by them and the study process is seriousl
> blocked, would you like to recommend some good method
> to pass this basic step? some quick lookup or some
> common-used cmd? Thanks
64 matches
Mail list logo