on Tue, 05 Nov 2002 01:10:51 GMT, [EMAIL PROTECTED] (Jose Malacara)
wrote:
I would like to be able to force them use the
server[number].[location] syntax and generate a warning if they
don't. Would it be possible to add a second argument test after
the first? Something like:
( $#ARGV eq
Hi,
try this :
#!/usr/bin/perl -w
use strict;
sub Usage() {
die Usage: $0 server[number].[location]\n;
}
$_ = shift;
Usage unless ((defined $_) (/^server(\d+)\.(\w+)$/));
print param is $_\n;
---
take a look at perlre.
A+
Jose Malacara a écrit :
I would like to be able to verify the
Hi all,
I am reading through a collegue's perl script. In it he has the
following lines:
sub SomeSubName
{
my ($vara, $varb, $varc, @items) = @_;
my ($itemtype, %symbol);
...
}
The first line I understand; here you are getting the parameters to the
subroutine (which are stored in @_),
Hi,
the second line is simply declaring two variables:
1 - the scalar $itemtype
2 - the hash %symbol
just another way to say
my $itemtype;
my %symbol;
no magic here, *NOT* a list or data structure.
A+
David Buddrige a écrit :
Hi all,
I am reading through a collegue's perl script. In it he
beaut! thanks.
David. 8-)
Jean Padilla wrote:
Hi,
the second line is simply declaring two variables:
1 - the scalar $itemtype
2 - the hash %symbol
just another way to say
my $itemtype;
my %symbol;
no magic here, *NOT* a list or data structure.
A+
David Buddrige a écrit :
Hi all,
I am
I just re-installed perl 5.8.0 on my mac. When I did the new version
was placed into /opt/bin where I do not want it so I moved all the
files and man pages to where they should be. Now How do I change the
@INC array?
I would also like to know how to change the other information listed
with
todd shifflett said:
I just re-installed perl 5.8.0 on my mac. When I did the new version
was placed into /opt/bin where I do not want it so I moved all the
files and man pages to where they should be. Now How do I change the
@INC array?
You don't. Your options are:
- recompile perl
this *should* work:.
__ START __
my $path = qq~/home/phisher/documents~; # set this to your path
opendir(DIR,$path) or die(can't readdir $path: $!); # open the entire
directory for getting the contents of
while (my $file = readdir DIR) { # $file gets assigned the next value of
DIR, and exits when
Hi,
I have written script that makes lot of files but the problem is that my
script stores all the files at the location from where the script is run. I
have tried usingt chdir(c:\abc) in order to store all the files in abc
directory but its of no use and still it stores files in the directory
Hi
I have two hashes with different set of keys,but I woul like to sort the two hashes by
keys and compare their elements.could anyone tell me how to do this.
I am trying to compare 'raimah' a hash with 'db2hash'
I am trying to compare the first sorted element of raimah hash with the first
__ START __
my $path = qq~C:\path\where\to\put\stuff~;
open (WHATEVER,qq~$path\filename.ext~) or die (qq~Can't open
$path\filename.ext for writing : $!~);
etc..
close(WHATEVER);
__ END __
Note: untested, but i doubt anything can go wrong.
give that a go.
dan
Ankit Gupta [EMAIL PROTECTED] wrote
Thank you. I decided to recompile perl, which seemed to work well.
The big problem I am having is getting the GD.pm module to work because
it
needs shared libraries which I am having trouble installing.
Have you had any luck installing libgd, zlib or the GD perl module?
I guess if you're using
dan said:
__ START __
my $path = qq~C:\path\where\to\put\stuff~;
open (WHATEVER,qq~$path\filename.ext~) or die (qq~Can't open
$path\filename.ext for writing : $!~);
etc..
close(WHATEVER);
__ END __
Note: untested, but i doubt anything can go wrong.
Might I suggest testing next time ;-)
Using: Mac OSX 10.2
libgd 2.0.4
Can anyone help me make something of this?
when I try and install GD.pm I get the following errors:
cc -c -I/sw/include -I/usr/local/include/gd -I/usr/lib
-I/System/Library/Perl -pipe -fno-common -no-cpp-precomp
-fno-strict-aliasing -O3
On Tuesday, November 5, 2002, at 10:23 AM, todd shifflett wrote:
Thank you. I decided to recompile perl, which seemed to work well.
The big problem I am having is getting the GD.pm module to work
because it
needs shared libraries which I am having trouble installing.
Have you had any luck
How exactly could I accomplish combining the values? Forgive me, I'm still
a little wet behind the ears using Perl.
Joshua Scott
Security Systems Analyst, CISSP
626-568-7024
-Original Message-
From: LRMK [mailto:lrmk;rakhitha.cjb.net]
Sent: Tuesday, November 05, 2002 9:18 AM
To:
well i could spend ample amount of time testing code for someone else. like
everyone else here, i'm only offering suggestions on how a problem can be
overcome. seriously, if someone is trying to create a perl script, they'll
have at least some knowledge in perl on how to fix errors if something
@_ holds the values of parameters passed to the sub when it is called from
the code
when it is used like that in subs
It has different meanings in different places
it is called default input variable
- Original Message -
From: David Buddrige [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
On Tuesday 05 Nov 2002 5:01 pm, Scott, Joshua wrote:
Hello everyone,
I'm trying to use the Mail::Sendmail module in a script where I need a
independent mailer. The problem I'm having is including more than one line
of text in the message body. I'm not really sure how to do this. The
there is a one problem
$mail{message}=FIN; only reads the first line of the file
in the following block;
$oldsep=$/; $/=undef; disable line seperation
open(FIN,myfile)||die cannot open file: $!\n;
$mail{message}=FIN;
close(FIN);
$/=$oldsep;
try this instedof that line
@file = FIN;
#!/usr/bin/perl -w
my $a;
if ($a eq 'fff'){
}
above line gives the error Use of uninitialized value in string eq at t.pl line 6.
but when -w not used in top line it works perfect
what the -w really does
I have two related questions; for the first time, I have the opportunity
to teach a 1-unit 5-week course on Perl in the Spring 2003 semester.
1. I'm curious if anyone has any opinions for their favorite
beginning-Perl textbook?
I really like Learning Perl, 2nd Edition, by Schwartz and
Hello everyone,
I'm trying to use the Mail::Sendmail module in a script where I need a
independent mailer. The problem I'm having is including more
than one line
of text in the message body. I'm not really sure how to do this. The
package uses a $mail{message} = blah var for the
I have two related questions; for the first time, I have the
opportunity
to teach a 1-unit 5-week course on Perl in the Spring 2003 semester.
1. I'm curious if anyone has any opinions for their favorite
beginning-Perl textbook?
I really like Learning Perl, 2nd Edition, by Schwartz and
On 11/5/02 12:47 PM, Sharon M. Tuttle [EMAIL PROTECTED] wrote:
I have two related questions; for the first time, I have the opportunity
to teach a 1-unit 5-week course on Perl in the Spring 2003 semester.
1. I'm curious if anyone has any opinions for their favorite
beginning-Perl textbook?
The '-w' helps you debug your code by producing warnings. The code may
work, but $a has not been initialized when it reaches the if statement, so
it will always fail. Is that really 'perfect'? Why have the if block if
you know it will never be executed? The easy, although prone to overuse,
use this
open (FILE _HANDDLE,'c:\abc\abc.abc');
- Original Message -
From: Ankit Gupta [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, November 06, 2002 5:07 AM
Subject: Files at different location
Hi,
I have written script that makes lot of files but the problem is
Hello LRMK,
At 11:51 PM 11/5/2002 +0600, LRMK wrote:
#!/usr/bin/perl -w
my $a;
if ($a eq 'fff'){
}
above line gives the error Use of uninitialized value in string eq
at t.pl line 6.
but when -w not used in top line it works perfect
what the -w really does
You've created $a but not set it to
On Tue, 2002-11-05 at 12:47, Sharon M. Tuttle wrote:
1. I'm curious if anyone has any opinions for their favorite
beginning-Perl textbook?
I really like Learning Perl, 2nd Edition
I am not a programmer at all, I came at Perl from the sysadmin side.
Learning Perl 3 was an incredible
David Buddrige wrote:
Hi all,
Hello,
I am reading through a collegue's perl script. In it he has the
following lines:
sub SomeSubName
{
my ($vara, $varb, $varc, @items) = @_;
my ($itemtype, %symbol);
...
}
The first line I understand; here you are getting
--Howdy:
--I've installed ActiveState 2.1.6 on Windows NT serv. pak 6.
--I'd like to install a few modules with the ppm too, but
--it doesn't seem to be working. As I understand it, all I
--should have to do is :
[snip]
ppminstall DBI
pmminstall DBD-Oracle
[/snip]
--my error is this:
D:\PERL\BINppm
PPM interactive shell (2.1.6) - type 'help' for available commands.
PPM install dbi
Install package 'dbi?' (y/N): y
Installing package 'dbi'...
Error installing package 'dbi': Could not locate a PPD file
for package dbi
PPM version
2.1.6
PPM
[/snip error]
Hi, try
What is the best way to replace line feeds in perl scripts that I copy from my PC to
my Unix machine? They don't run on the Unix side unless I open an editor and
find/replace the line feeds/carriage returns.
function SetDomain(d) { document.domain = d; }
What is the best way to replace line feeds in perl scripts
that I copy from my PC to my Unix machine? They don't run on
the Unix side unless I open an editor and find/replace the
line feeds/carriage returns.
tr -d '\015' file newfile
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
From: Johnson, Shaunn [EMAIL PROTECTED]
--I've installed ActiveState 2.1.6 on Windows NT serv. pak 6.
No you did not.
You installed ActiveState ActivePerl 6xx which is Perl version 5.6.1
+ some patches.
If you want to know the exact version run
perl -v
Only the PPM installed with it
does anyone know why I can't enqueue an array ref?
the error is this:
Invalid value for shared scalar at /usr/lib/perl5/5.8.0/Thread/Queue.pm
line 90.
TIA,
jjv
__CODE__
#!/usr/bin/perl
use 5.008;
use warnings;
use strict;
use threads;
use Thread::Queue;
my $q = Thread::Queue-new ();
I'd like to know the best/easiest way to sort a hash based on the values of
it's keys. Here is a snippet of my code.
%somehash=();
foreach (somearray) {
$somehash{$_}++;
};
Basically I'm getting a count of unique items in an array and I want to sort
by the number of each item. I've
From: Scott, Joshua [EMAIL PROTECTED]
I'd like to know the best/easiest way to sort a hash based on the
values of it's keys. Here is a snippet of my code.
%somehash=();
foreach (@somearray) {
$somehash{$_}++;
};
Basically I'm getting a count of unique items
From: Jeremy Vinding [EMAIL PROTECTED]
does anyone know why I can't enqueue an array ref?
the error is this:
Invalid value for shared scalar at
/usr/lib/perl5/5.8.0/Thread/Queue.pm line 90.
Because you'd have a shared reference to a private array.
I believe the docs for threads.pm and
From: Jeremy Vinding [EMAIL PROTECTED]
On Tue, 2002-11-05 at 14:18, Jenda Krynicky wrote:
Because you'd have a shared reference to a private array.
I believe the docs for threads.pm and Thread::Queue explain this.
I'm not using Perl 5.8 yet so I can't tell.
they don't but i guess
funny, i used the ppm to install DBI on my server, it's a win2k service pack
3, but nevertheless, still the same perl software. try:
ppm install DBI
case sensitive.. maybe?
dan
James Kipp [EMAIL PROTECTED] wrote in message
From: Jason Frisvold [EMAIL PROTECTED]
I'm curious if there are any side effects to doing the following :
#!/usr/bin/perl
use strict;
use warnings;
my $var1 = test1;
my $var2 = this is not test2;
{
my $var2 = test2;
print $var1 - $var2\n;
}
print $var1 - $var2\n;
What I'm
the second 'my $var2' will have memory allocated to it, but will not be
freed until Perl ends, but Perl will re-use that memory allocation after
leaving the {BLOCK}.
-Original Message-
From: Jason Frisvold [mailto:friz;corp.ptd.net]
Sent: Tuesday, November 05, 2002 4:43 PM
To: [EMAIL
That is exactly what I was hoping...
Thanks!
On Tue, 2002-11-05 at 16:48, Nikola Janceski wrote:
the second 'my $var2' will have memory allocated to it, but will not be
freed until Perl ends, but Perl will re-use that memory allocation after
leaving the {BLOCK}.
--
Hi all,
I am writing an administration interface to my mailing list.
Upon opening the program it displays the email addresses of all the subscribers along
with a delete link next to each name.
The subscribers are written to a hash.
When you click delete link the name/value pair is passed
On Tue, 2002-11-05 at 14:34, Jenda Krynicky wrote:
From: Jeremy Vinding [EMAIL PROTECTED]
On Tue, 2002-11-05 at 14:18, Jenda Krynicky wrote:
Because you'd have a shared reference to a private array.
I believe the docs for threads.pm and Thread::Queue explain this.
I'm not
Johnny Hall wrote:
Hello all,
Hello,
I am trying to take a file of variable length on a daily basis and
divide it up into 4 equal parts for processing on each file. Does
someone have an easy way to do this?
The original file is just a series of numbers like..
3233404936
3233404934
Hi Shaunn,
I am running W2K SP3 and it installs OK.
pmminstall DBD-Oracle
PPM install dbd::oracle
Install package 'dbd-oracle?' (y/N): y
Installing package 'dbd-oracle'...
Bytes transferred: 92963
Installing C:\Perl\site\lib\auto\DBD\Oracle\Oracle.bs
Installing
Along the lines of what has been mentioned, do a search in the ActiveState
page for the HTTP_PROXY environment variable. I believe just looking up the
word firewall will get you the articles you're looking for.
-Original Message-
From: ss004b3324 [mailto:meecho;blueyonder.co.uk]
Sent:
Lo everyone,
How do I read environment variables with perl?
--
me
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
They're automatically stored in the %ENV hash. Note that if you are using
NT/2000/XP, you cannot use this hash to PERMANENTLY change environment
variables.
-Original Message-
From: Chris Knipe [mailto:savage;savage.za.org]
Sent: Tuesday, November 05, 2002 11:13 AM
To: [EMAIL PROTECTED]
Using Perl on a Linux system, is there a way to fork off x amount of copies
then make a system wait until those copies are finished before forking off
more copies? If so can you show me an example if possible. It would be
greatly appreciated! TIA
Jessee
--
To unsubscribe, e-mail: [EMAIL
Hi all,
I am writing an administration interface to my mailing list.
Upon opening the program it displays the email addresses of all the subscribers along
with a delete link next to each name.
The subscribers are written to a hash.
When you click delete link the name/value pair is passed
Thank You. What is the string if I am going the other direction?
ie. Mac to PC translation.
Kipp, James [EMAIL PROTECTED] wrote:
What is the best way to replace line feeds in perl scripts
that I copy from my PC to my Unix machine? They don't run on
the Unix side unless I open an editor and
Gidday from downunder,
When writing PHP if I want to an include I type include(filename.php);
Is there a similar command in PERL, does require do the job? In my mailing list
application I re-use numerous functions and would like to pop these in a function
library and include them on every
I think 'use' is what you're looking for. But just in case,
perldoc -f require
perldoc -f use
perldoc perlmod
On the last one, I would recommend reading the first section and then
skipping down to the Perl Modules section. Then you can go back over the
whole thing. Just to give you a taste
I think my problem should be rather solved in JavaScript, but where can I find help? I
tried many different keywords on goggle to find some info on accomplishing the
following (but without success):
I have two pull-down menus. How can I make the values (choices) in the second
pull-down menu
hey can someone give me a tip to where i can find the pearl
packages on redhat8?
i'm getting real confused trying to set them up
but i know they're there...
help please
_
a href=http://www.gamedev.net;GameDev.net Email Service/a -
this is not a perl question. better posted to a HTML/javascript list.
nonetheless the following works ...
form
select name=category onclick=updateSubCategory(this.value);
option value=/option
option value=AA/option
option value=BB/option
/select
select
On Sunday 03 November 2002 11:25, John Pitchko wrote:
Sorry this took me so long to respond to. Yes, that is part of if not the
full answer to your question. You make the data binary before writing it to
a file.
- Jim
| Ok so then how do I make my data binary? Use pack() and unpack() ?
|
|
I am writing and/or modifying some perl scripts - they have
they r for test automation for installation of some product and/or its patches ,
scripts have basic requoirement as perl 5.6.1 must be installed on the machine
wherever r scripts
gona fired ,
now my question could it
Thanks Aman
can u also tell me some site to download
perl 5.8 gz or tar.gz for hp ux 11.00
i downloaded some , but they r depot.gz - i don't know about depot-
or how to use them
Regards
Pradeep
- Original Message -
From: Aman Thind [EMAIL PROTECTED]
To: PRADEEP GOEL [EMAIL
Hi
Yeah sure.
You could look it up in : ftp://theoryx5.uwinnipeg.ca/pub/other
I found my win32 tar there.
Thanks
Aman
-Original Message-
From: PRADEEP GOEL [mailto:pradeepg;india.hp.com]
Sent: Wednesday, November 06, 2002 12:33 PM
To: Aman Thind; [EMAIL PROTECTED]
Subject: depot?
Yeah this will sure do the trick but just in case you need another option to
do the same , require is also there to the rescue.
Just put all the functions you require in a separate .pl file.
The following solution can also be implemented as :
#
# Sample.pl
sub
64 matches
Mail list logo