Okay my script takes names from a fom and puts them into an array - then later I need
to match a $variable (one of the names) against that array and take that specific
element out of the array. I figure there is probably an easy function to do this?
array=(john, lucy, mike);
$name=john
I
Hi All,
I want to use the Class-Tree-1.20 module. But I am
unable to install and use it b'coz it is giving some
error
Environment variable 'perceps' not found
I have read the README file and documentation for
'perceps'. But still I am unable to resolve it.
Can you please help me?
Thanks,
Rob Roudebush wrote:
Okay my script takes names from a fom and puts them into an array - then later I
need to match a $variable (one of the names) against that array and take that
specific element out of the array. I figure there is probably an easy function to do
this?
@array=(john, lucy,
Here is my way:
if(scalar(grep(/^$object$/, @Equipped))) {
@Equipped= grep { $_ ne $object } @Equipped;}
It searches the array @Equipped for an objext if it finds it then removes it
be searching threw the whole array and skiping the object as it assigns it
to the array. Hope this helps.
hi,
Thank You. This problem is solved when a client is contacted Directly to my server.
But What about Other users connecting through their Proxy's
Is there any chance to Rectify this
Thanx
vijay
- Original Message -
From: Rob Roudebush
To: vijayak ; [EMAIL PROTECTED]
what do i have to do to make changes to a form like change the background
colour of a text field or the face of a button? is it in perl or what?
--
Matthew Harrison
Internet/Network Services Administrator
Peanut-Butter Cheesecake Hosting Services
Genstate
www.peanutbuttercheesecake.co.uk
--
That all depends on if you want to do it server side or client side. I
usually prefer the server side, in which case your Perl script would handle
that. The easiest way is to use some sort of template module, I usually use
HTML::Template.
I'm attempting to parse a domain name out of a email address with the
following code:
my $EmailAddress = $to;
if ($EmailAddress =~ (/^\w+\@aol\.com)$/i){
my $msg = /www/docs/sips_mar02aol.txt;
} else
my $msg = /www/docs/sips_mar02.html;
}
Being new to regular
for starters the regex is invalid. the first closing parens comes too soon.
try:
if ($EmailAddress =~ (/^\w+\@aol\.com$/i)){
tim
-Original Message-
From: Eric Peers [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 1:45 PM
To: [EMAIL PROTECTED]
Subject: parsing a domain
Thank you. That helped get the script to compile. Neither file is being
opened, but that me be a permissions issue. I've expanded the code out a
bit (and made a correction to the if/then statement):
my $EmailAddress = $to;
if ($EmailAddress =~ (/^\w+\@aol\.com$/i)) {
my $msg =
Hi Eric,
I believe you need a blank line after the email header before you start your
message body.
-Rand
-Original Message-
From: Eric Peers [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 11:50 AM
To: Tim Doty; [EMAIL PROTECTED]
Subject: Re: parsing a domain name out of an
Hi Scott,
I am in the same boat like Matthew here.
Do you have any examples to implement selection list boxes, text boxes, as
well as checkboxes?
I'd just like to see how you would do that using this style of html:
use CGI; # use CGI.pm
$q = new CGI; # initiate a new CGI object
Jessica, most of the information you are looking for is available in the
help documentation for CGI.pm. Try 'perldoc CGI.pm' and go through it until
you find the form examples. Here's a *very* basic example of a form with a
select menu:
#!/usr/bin/perl
use CGI;
use strict;
my $q = new CGI;
Sorry, setting up the CGI object was useless in that case, since I didn't
use the object to create the fields. My bad. Sorry.
-Original Message-
From: Scot Robnett [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 6:13 PM
To: Jessica Ortiz; [EMAIL PROTECTED]
Subject: RE: html in
I have a small series of web pages that talks to a database and uses
forms to input/alter data.
In order to get to these web pages a user has to authenticate. If
valid, I put a cookie on their machine that expires in 10 minutes. So
basically, they can use the forms for up to 10 minutes, from
I'm not sure, but how do you set a cookie and have it
expire in ten minutes?
-Rob
--- Sean Abrahams [EMAIL PROTECTED] wrote:
I have a small series of web pages that talks to a
database and uses
forms to input/alter data.
In order to get to these web pages a user has to
authenticate. If
Had to uninstall ActivePerl and reinstall, rather than just install over older
version, and then it worked, no need to 'ppm install LWP::Simple'.
use LWP::Simple;
if (my $img = get($image_url)) {
open OUT, $file_to_write;
binmode OUT;
hi
i have a loop containing the following block of code. however, first time the loop is
run, $text_link is empty, which it shouldn't be. i cant move the declaration of
$text_link above the if statment, because then the $figure_name would be empty.
now i guess im really missing out on
if ( ( $hash - { $paragraph } ) =~
s/###(\w+.*\.jpg)###/($text_link)/ ) {
Obviously you ain't using warnings or strict if
$text_link has any chance of being undefined.
Also, you should have a else clause, looking
something like:
else {
undef $test_link;
}
Jonathan Paton
I am writing a perl program in which I need to execute
a korn shell script and pass it multiple arguments. I
am assuming that I can use the system routine but I
am not sure what the syntax would be. Can you help?
--
__
Your
--- Kubert [EMAIL PROTECTED] wrote:
I am writing a perl program in which I need to execute
a korn shell script and pass it multiple arguments. I
am assuming that I can use the system routine but I
am not sure what the syntax would be. Can you help?
Do you need information back? If
From: [EMAIL PROTECTED] (Martin A. Hansen)
i have a loop containing the following block of code. however, first
time the loop is run, $text_link is empty, which it shouldn't be. i
cant move the declaration of $text_link above the if statment, because
then the $figure_name
I am planning to write a litte graphical interface for an application that has a full
CLI. Perl Tk, should accomplish this. What i need is more information then the one
that is in the perlfaq, i need instructions, faqs,snippets, all i can get, can anyone
point me in the right direction for
This might seem trivial, but it has me stumped.
The variance of numbers 0..20 is 38.5.
Then why does Math:NumberCruncher show it as 36.6667?
Here's a sample prog, and it's output. Here test04.dat is a file that has
numbers 0 to 20, on separate lines.
#---start
Hi Tirthankar,
I knew my Graduate work in Statistics would come in handy at some point...
:-) Without looking at the documentation for Math:NumberCruncher, I can
fairly confidently say that both you and Math:NumberCruncher are right, but
you are trying to calculate different things. In the
Hi Nick,
I cannot tell you how ashamed I am. This should've been absolutely
obvious to me (I also did graduate studies in Statistics, after which I
switched to Economics, and Finance.) I guess it's TGIF feeling, or just
workload, but my mind didn't perhaps work, when I failed to
Remember your command ticks.
$my_output = `do_something`;
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Just wondering how I would go about having this URL
www.mydomain.com/cgi-bin/test.cgi?data=test
Would be parsed to...
www.mydomain.com/cgi-bin/test2.cgi
From test2.cgi I would like to be able to read that data = test from
test.cgi.
In test.cgi, do the following
=code
use CGI;
my
if ( ( $hash - { $paragraph } ) =~
s/###(\w+.*\.jpg)###/($text_link)/ ) {
$figure_name = $1;
$text_link = $cgi - a({-href = javascript:
window.open('$pix_dir/$figure_name',
. '',
. 'status=yes,
Hi Troy,
Then I have the following code to re-assign it to variables:
---
unless ($action) {
open (TEMP,$filename2) or die Can't Open $filename2:
$!\n; $line = TEMP; close(TEMP); ($dt, $time, $topic,
$eurom) = split(/\|/, $line); $eurom
Tirthankar C. Patnaik wrote:
This might seem trivial, but it has me stumped.
The variance of numbers 0..20 is 38.5.
Then why does Math:NumberCruncher show it as 36.6667?
Here's a sample prog, and it's output. Here test04.dat is a file that has
numbers 0 to 20, on separate lines.
Hi all,
I wonder if anyone can help me - i am writting some perl scripts that read
information off a database. What I want to do is use different html
templates (the location if which can be stored on the database) to display
the relevant information. For example: if i read data off a database
What I want to do is use different html
templates (the location if which can be stored on the
database) to display
the relevant information. For example: if i read data off a
database that
has 3 pictures i would use 1 template, if the page has 4 pics
i would use
another template.
Hi, two questions: is there an easy way -- using printf, etc. -- to
format 100 such that it appears as 1,000,000? Also, is there a
searchable archive of the beginner list anywhere?
Thanks, Brian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On Mar 15, Brian Warn said:
Hi, two questions: is there an easy way -- using printf, etc. -- to
format 100 such that it appears as 1,000,000? Also, is there a
searchable archive of the beginner list anywhere?
As per commas, the Perl FAQ has the answer:
perldoc -q commas
As for the
I don't know of a searchable archive.
To format the number you can either roll your own, grab the solution in the
Perl Cookbook, or use Number::Format.
http://search.cpan.org/search?mode=modulequery=Number%3A%3AFormat
use Number::Format;
my $commaNum = new Number::Format(-thousands_sep =
I tried the following code to retrieve netCDF data files from a website.
use LWP::Simple
getstore(source_url/, input_filename);
The problem is when I go to read the netCDF file I can't. It is as if it
does an ASCII transfer instead of a binary or some such thing? Don't really
know. Any
I've been growing interested in the Tk module too. I found this today.
It's really really introductory.
http://www.perl.com/pub/a/1999/10/perltk/
Hello,
I have a perl script which is working as TCP socket server.
In this I am redirecting STDOUT to file.
with command in the begining of the script:
open STDOUT, './tRL.out' or die ./tRL.out: $!;
I have following four print STDOUT commands
while (accept(CLIENT,SERVER)) {
siren jones [[EMAIL PROTECTED]] quoth:
*I tried the following code to retrieve netCDF data files from a website.
*
*use LWP::Simple
* getstore(source_url/, input_filename);
perl -MLWP::Simple -e 'getstore http://www.cpan.org,foo;'
works like a charm.
However, yours, with the addition of -w
Guys, I've got a newbie question - I have been hacking at a perl script to
change it to do what I want - it nearly does but I can't understand why the
main bit isn't working. Basically the script gets sent a string from an
html form which it then needs to use as part of a system command.
I'm
when studying PERL, how many months does it generally
take to get past the baby talk stage?
any estimates?
__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Months you say? hehehe I don' think I'll ever get out of it.
- naika
http://www.naikaonline.com
-Original Message-
From: crash [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 15, 2002 3:49 PM
To: [EMAIL PROTECTED]
Subject: kung foo
when studying PERL, how many months does it
--- Gavin Nelmes-Crocker [CobaltWorld] [EMAIL PROTECTED] wrote:
Guys, I've got a newbie question - I have been hacking at a perl script to
change it to do what I want - it nearly does but I can't understand why the
main bit isn't working. Basically the script gets sent a string from an
html
It took me about six months before I started to feel like I could hold my
own. Of course, four months later I realize that I just didn't know enough
about some things to realize how much more I needed to know. For me one of
the great things about Perl is that you can learn the basics very
when studying PERL, how many months does
it generally take to get past the
baby talk stage?
Assuming full time, and some experiance of
other languages you should be quite proficent
after 2-3 months... I created my first script,
Tk script, module and object by then - albeit
they were'nt
hi,
I have a html form with over 100 fields, is there a quick way to assign them in the
way that the scalar name becomes the name of the field and the value of the field is
being assigned to that scalar? I know I can just type it one by one:
$name = param('name');
$lastname = param('lastname');
You can use the import_names function of CGI
import_names( 'R' );
print name = , $R::name;
This function will import all of the parameters into the namespace provided
as the argument (in this case, R). If the parameter is multivalued, then
you can use the array form( e.g. @R::name ).
Hi, Mariusz, :)
I don't qualify as an expert, but this might do the trick:
my %params;
$params{$_} = param($_) foreach param();
If I understand your code correctly, param() returns a list of all the
possible keys, right? If so, then the above code should work. You refer to
the parameters as
I have looked through the Camel book a couple of times, and I am still
confused as to the usefullness of the eval, and BEGIN type structures. Could
someone give me a 'real-world' example, and possibly another explanation of
the two structures? I would like to know if I should be using them in my
From: James Kelty [EMAIL PROTECTED]
I have looked through the Camel book a couple of times, and I am still
confused as to the usefullness of the eval, and BEGIN type structures.
Could someone give me a 'real-world' example, and possibly another
explanation of the two
HI, all:
I am wondering what else 'use strict' does besides it
is stated in the perldoc that it stricts on use of
'vars', 'refs' and 'subs'. Thanks.
yc
__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/
--
Hi everyone! I hope someone can tell me what I'm doing wrong.
I'm running ActivePerl 5.6 on an NT4 (service pack 5) box.
One of the things I have to do is to have a Perl script map a network
drive to a drive letter.
When one manually does this from the command line, it is done using the
net
The 'use strict' pragma is a little hard to get used to if you have
been coding a while without it, but can be a great help in creating and
debugging your programs. 'use strict' lets the perl interpreter know that
you want all variables, subs, and references to be declared and scoped.
Maybe system() isn't the right way to go with this. Try using backticks
(`net use * server\\share`) or use the Win32::Lanman modules
NetShareAdd() function. My personal take on system() and backticks is that
they should only be used when absolutely necessary. You can control what
Perl
Francoys Crepeau wrote:
Hi everyone! I hope someone can tell me what I'm doing wrong.
Hello, I hope so too.
I'm running ActivePerl 5.6 on an NT4 (service pack 5) box.
One of the things I have to do is to have a Perl script map a network
drive to a drive letter.
When one manually does
Hi everyone,
I'm working on a script that will compile statistics for helpdesk tickets. To compute
these stats, I need to be able count the number of business hours between the
opening and the resolution of tickets. The working hours are 08:00 to 17:00 so a
ticket opened on Monday at 16:00
You're right!
It appears that I'd been considering net use to be a command, when it
appears that net is the command and use is a modifer.
I haven't been able to double check it yet here at home, but when I
modify the test program to invoke only net use, I get the expected
report, and the test
58 matches
Mail list logo