on Mon, 13 May 2002 20:16:08 GMT, [EMAIL PROTECTED] (Shaun Fryer)
wrote:
> I'm curious if anyone has an better idea of how to recieve
> multiple lines of into a single array.
> [...]
> sub PromptForBody {
> print ': ';
> $thisLine = ;
> unless ($thisLine eq ".\n") {
> push(@messageBo
Could try this too
perl -p -i.bak -e '/^ftp/ ? undef $_ : s/\bguest\b/ftp/gi' /etc/passwd
the -i.bak will also create a /etc/passwd.bak for you
Timothy Johnson wrote:
>
> Actually it's a good question, and I should have explained myself. When you
> do this line on a file, it slurps up the ent
Hi all, first post, so please be nice.
I've got a simple sockets server running
$local = IO::Socket::INET->new(Proto=>"tcp", LocalPort=>"23", Listen=>"1")
or die "Can't open Socket\n";
$remote = $local->accept;
$remote->autoflush(1);
I'm reading input like so...
while (<$remote>) {print;
Actually it's a good question, and I should have explained myself. When you
do this line on a file, it slurps up the entire contents of the file into an
array:
@infile = ;
So the way to read a huge file without loading the entire file into memory
is to use a while loop:
but this changes t
Anyone use this module? I can't seem to use a file handle for the stream. The syntax:
use HTML::Stream qw(:funcs);
open (FP,">$htmlfile") || die "Could not open file $htmlfile for write\: $!\n";
$ht =3D HTML::Stream->new (FP);
$ht->text("This is a test\n");
give
I am getting the following error, does anyone know what could be causing
this?
No recipient addresses found in head
Thanks
Lance
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Think I figured it out properly.
if ($_ =~ /^\$myquery/) { quotemeta($_); (undef, $line{myquery}) =
split(/=/, $_, 2); }
This gives me MYQUERY = "url=$url&email=$email&i_rank=yes";
If this is not the 'proper' way please let me know of a better way.
Thanks
zack
"Zachary Buckholz" <[EMAIL PROT
I have a bunch of text files that follow the format
variable = value
I am trying to read each file and insert it into SQL but before I can do
that I need to parse
the values into a hash.
One of the fields has the URL which can contain & and = characters, so after
the first split I seem to miss
On Monday, May 13, 2002, at 10:40 AM, Todd Wade,,,Room 108 wrote:
> Bob Ackerman wrote:
>
>>
>> this one wins the prolix award of the solutions we have seen today.
>> we dare a non-perl programmer to believe this could mean something.
>> I'm not sure i believe it means whatever. especially (?)(
To add what Chas mentioned, it also changes the context of the expression.
One good example is the localtime() function. In "scalar" context it
returns a date string, and in "list" context it returns a list of the date
parts. When you use the parens on the left side of the assignment you are
fo
On Mon, 2002-05-13 at 18:07, Scott Lutz wrote:
> I am wondering about the different ways of initializing a single scalar.
>
> usual method:
> my $variable;
>
> but I am trying to get what (if anything) is being done differently by
> this :
> my ($variable);
>
> Thanks!
>
>
> Scott Lutz
> Paci
I am wondering about the different ways of initializing a single scalar.
usual method:
my $variable;
but I am trying to get what (if anything) is being done differently by
this :
my ($variable);
Thanks!
Scott Lutz
Pacific Online Support
Phone: 604.638.6010
Fax: 604.638.6020
Toll Free: 1.877.5
Ok that seems to do the trick, the only thing I am worried about is during
the installation to the real directory some data is appended to
perllocal.pod. The documentation for MakeMaker say you can disable this
with pure_install, but I can't find anywhere that explains the use of
perllocal.pod.
Let me ask this question.. when passing variables from a HTMl form to a CGI
script do you need to do anything special to the environment.
The reason I ask is I took an html page off server_1 and used the exact
script that they used on the server_1 to process the email. Placed it on
Server_2 wit
I'm curious if anyone has an better idea of how to recieve multiple
lines of into a single array. For example, I've written a
really basic emailer for administrating email lists I'm on. I can get
it to recieve single line entries, such as a To: From: CC: etc from
with no problem, but haven't yet
Todd Wade wrote:
>
> John W. Krahn wrote:
>
> > Todd Wade wrote:
> >
> > Why remove everything you don't want, why not just capture the data you
> > do want?
>
> sure
>
> >> $weather =~ tr/[A-Z]\n/[a-z] /;
> > ^ ^ ^ ^
> > Why are you translating a '[' to '[' and ']
>-Original Message-
>From: drieux [mailto:[EMAIL PROTECTED]]
>>
>> sub unique {
>
>neat function
>
>> }
>
>may I counter propose based upon the benchmarks
>
>http://www.wetware.com/drieux/pbl/BenchMarks/uniqbyRefOrArray.txt
>
>ciao
>drieux
>
>---
>
>ps: harry, I have referenced
On Mon, 2002-05-13 at 15:01, Craig Moynes/Markham/IBM wrote:
> Hi all,
> Our servers are set up with a single development box, that contains
> all the compilers and what not. All the modules I need to install have to
> be compiled on the development box, and then installed on each server (m
Damir Horvat wrote:
>
> Hi!
Hello,
> I'm having problem dereferencing:
> ---
> %err = (
> "usage" => sub { die "\nUsage: $0 \n" },
> "zone" => sub { die "Zone allready exists!\n" }
> );
>
> $zone = lc $ARGV[0] || $err{'usage'};
> print "$zone\n";
$zone = lc $ARGV[0] || $err{
Hi all,
Our servers are set up with a single development box, that contains
all the compilers and what not. All the modules I need to install have to
be compiled on the development box, and then installed on each server (make
install). This works for now, (thanks to nfs) but I would like t
The ||= operator is used to set a default value, so that you have a value if
the user doesn't put one in. So what it is saying is that if $x doesn't have
a value or has a false value, then give it the value of $y if it is TRUE,
else make it an empty string. I can't see the usefulness out of cont
You can try something like this:
open(INFILE,"/etc/passwd");
@infile = ; #don't do this if your file gets big
close INFILE;
foreach(@infile){
if($_ =~ /^ftp/i){ #if it starts with "ftp"
$_ = '';#make it a zero-length string
}elsif($_ =~ /guest/i){ #else if it contains "guest"
Bob Ackerman wrote:
>
> this one wins the prolix award of the solutions we have seen today.
> we dare a non-perl programmer to believe this could mean something.
> I'm not sure i believe it means whatever. especially (?)(.) - zero or one
> character followed by a character?
> followed by a non-
> I have a question regarding passing variables from a HTML
> form to a CGI script. I have never worked with CGI in the
> past and assumed that if I included the variables with in the
> form and on submit called the CGI script that the variable
> would be amiable to it. That doe not see, to
John W. Krahn wrote:
> Todd Wade wrote:
>
> Why remove everything you don't want, why not just capture the data you
> do want?
sure
>
>> $weather =~ tr/[A-Z]\n/[a-z] /;
> ^ ^ ^ ^
> Why are you translating a '[' to '[' and ']' to ']'? Why are you
> translating "\n
Yeah, this seems to be a Perl 5 vs Perl 5.6 issue. In the third version
of the Camel on page 283 it says:
We could also have dereferenced it as &{ $HoF{lc $cmd} }(),
or, as of the 5.6 release of Perl, simply $HoF{lc $cmd}().
On Mon, 2002-05-13 at 11:56, Damir Horvat wrote:
> On
You could either redirect all STDERR output to a file, or pass all error
info to a sub routine. For the second method you could do...
if (system ($cmd)) {
&fatalError("Error $!\n");
}
sub fatalError {
my $error = shift;
open ERROR ">>error.txt" or die "Can't append to error.txt: $!";
Is there a better way of logging the details in a file.
E.g.
I would like the error message to go into a file instead of going to the stderr
if (system ($cmd)) {
die "Error $!\n";
}
I don't want to code the above as
open (LOG,"> $logFile");
if (system ($cmd)) {
print LOG "Error $!\
Bob,
Here is the portion of the HTML form below it you will find a portion of the
CGI Script: As you see at the top I am posting the form so like I said I
assume the variables will be passed. The other issue is I am using
JavaScript to validate client side but when it gets to the CGI script I a
> -Original Message-
> From: Lance Prais [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 13, 2002 11:15 AM
> To: Perl
> Subject: CGI QUESTION
>
>
> I have a question regarding passing variables from a HTML
> form to a CGI
> script. I have never worked with CGI in the past and assumed
>
>-Original Message-
>From: drieux [mailto:[EMAIL PROTECTED]]
>
>ps: harry, I have referenced you as the originator
>of the function - if that is incorrect - please send
>me email back channel indicating who should be blamed.
I am indeed the culprit.
H
**
On Monday, May 13, 2002, at 08:15 , Lance Prais wrote:
> I have a question regarding passing variables from a HTML form to a CGI
> script. I have never worked with CGI in the past and assumed that if I
> included the variables with in the form and on submit called the CGI
> script
> that the v
I have a question regarding passing variables from a HTML form to a CGI
script. I have never worked with CGI in the past and assumed that if I
included the variables with in the form and on submit called the CGI script
that the variable would be amiable to it. That doe not see, to be the case.
I
On Monday, May 13, 2002, at 07:07 , Jackson, Harry wrote:
[..]
>> -Original Message-
>> From: Lance Prais [mailto:[EMAIL PROTECTED]]
>
> I seem to require what you want a lot so wrote this. Pass the arrays you
> want the unique values of as references to this sub routine. There is no
> ch
> I am stuck on windows working with a process that runs
> as a service. There's a bug in the process (vendor
> code) and it doesn't show up in the output of net
> start, so net stop can't stop it.
>
> I need to have a script that kills this process using
> kill PID, but I am not aware of any
I'm writing a shell script, which will take a list of files on the
command line, so u run the script like
e.g
The list of files is not fixed, so I need to execute this for any number
of files given by the user
Step 1 Using either sed or gawk/awk , I need to separate these files by
white s
When you create an executable using perl2exe or PerlApp, the code isn't
actually "compiled" in the sense that you might be thinking. The
interpreter, your code, and all modules are embedded into the exe in such a
way that they can be extracted, linked, and run when you execute the exe.
You may
On Mon, 2002-05-13 at 10:45, Damir Horvat wrote:
> Hi!
>
> I'm having problem dereferencing:
> ---
> %err = (
> "usage" => sub { die "\nUsage: $0 \n" },
> "zone" => sub { die "Zone allready exists!\n" }
> );
>
> $zone = lc $ARGV[0] || $err{'usage'};
> print "$zone\n";
> ---
>
> bas
try
$zone = lc $ARGV[0] || &{$err{'usage'}};
-Original Message-
From: Damir Horvat [mailto:[EMAIL PROTECTED]]
Sent: Monday, May 13, 2002 10:45 AM
To: [EMAIL PROTECTED]
Subject: trouble dereferencing
Hi!
I'm having problem dereferencing:
---
%err = (
"usage" => sub { die "\nUs
> I'm going to be working with XML files on Windows. Notice
> that in Notepad (on
> W2K+) you can save a file with different encodings, including
> Unicode.
> W2K+These
> XML files are Unicode. Opened directly in Notepad, they take
> on an appearance of having extra spaces between character
Hi!
I'm having problem dereferencing:
---
%err = (
"usage" => sub { die "\nUsage: $0 \n" },
"zone" => sub { die "Zone allready exists!\n" }
);
$zone = lc $ARGV[0] || $err{'usage'};
print "$zone\n";
---
bash-2.05a$ perl dnsaddzone.pl
CODE(0x804eed0)
--
..
>-Original Message-
>From: Lance Prais [mailto:[EMAIL PROTECTED]]
I seem to require what you want a lot so wrote this. Pass the arrays you
want the unique values of as references to this sub routine. There is no
checking for the amount of arrays passed and will currently handle 4.
su
On Sunday, May 12, 2002, at 11:09 , Bill Lyles wrote:
> Yes that is correct
> - Original Message -
> From: "bob ackerman" <[EMAIL PROTECTED]>
>> On Sunday, May 12, 2002, at 09:38 PM, Bill Lyles wrote:
>>
>>> Huh?
my complements to bob for the 'translation'...
>> i think you are callin
> I am trying to accomplish the following and have been unable
> to find a good
> routine (or build one) which does an adequate job.
>
> 1. Paste a big text file into an html text box which contains email
> addresses scattered throughout.
You can use the CGI module for this. I'm not sure of
On Monday, May 13, 2002, at 12:09 , Mayank Ahuja wrote:
[..]
> $^O The name of the operating system under which this
> copy of Perl was built, as determined during the
> configuration process. The value is identical to
> $Config{'osname'}.
[..]
so why
Hi Group!!
I have an Optionmenu in my Tk application.
The Optionmenu has the following enteries ["First", "Second", "Third",
"Fourth"]
I also have 2 buttons in my application
If i press the Optionmenu should display the first option in
the Optionmenu i.e. "First" and
if i press the Optionmenu
> Please help me. I am trying to do pattern matching for an IP address. I have
> tried the following and it does not work:
> unless ( $ip =- /[0-223]\.[0-255]\.[0-255]\.[0-255]/ )
> {
> die ( "Invalid IP\n" );
> }
> print ( "Valid IP" );
>
> Is there a way I could
Greetings,
Please help me. I am trying to do pattern matching for an IP address. I have
tried the following and it does not work:
unless ( $ip =- /[0-223]\.[0-255]\.[0-255]\.[0-255]/ )
{
die ( "Invalid IP\n" );
}
print ( "Valid IP" );
Is there a way I could actuall
On Monday 13 May 2002 10:10 am, Wim wrote:
> Hello,
>
> I'm looking for the DBI-driver for Postgres. Some months ago, I could
> download it from dbi.symbolstone.org.
> This site doesn't exists anymore. Can someone point me to the DBI
> interface for postgres?
> I searched cpan, but couldn't find i
on Mon, 13 May 2002 07:21:31 GMT, [EMAIL PROTECTED] (Jonathan
e. paton) wrote:
> Thus, your original program is compiled into Perl bytecode,
> and is then run through a full interpreter - you have all the
> power of Perl. However, this means perl2exe is a poor way to
> increase speed (i
Hello,
I'm looking for the DBI-driver for Postgres. Some months ago, I could
download it from dbi.symbolstone.org.
This site doesn't exists anymore. Can someone point me to the DBI
interface for postgres?
I searched cpan, but couldn't find it :-(
Thanks
Wim
--
To unsubscribe, e-mail: [EMAI
Hi, i have this file /etc/passwd like this:
Everyone:*:0:0:,S-1-1-0::
SYSTEM:*:18:18:,S-1-5-18::
Administrators:*:544:544:,S-1-5-32-544::
Administrator:unused_by_nt/2000/xp:500:513:U-LININF54\Administrator,S-1-5-21-175
7981266-2139871995-725345543-500:/home/Administrator:/bin/bash
anonymous:unus
Thanks a lot Timothy for the help,
Regards
Amod
Amod A. Kakadé
intel* India
ARIES - DSS Project
6th Floor, Du Parc Trinity,
17 M. G. Road
Bangalore, 560 001, India
Phone 91 80 555 0940 / 531 8120 Ext. 2327
Fax 91 80 5321908
INET8 262 2327
-Original Message
> ooopss!! i was wrong ... $^O worked
>
> According to "perldoc perlvar" :
>
> $^O The name of the operating system under which this
> copy of Perl was built, as determined during the
> configuration process. The value is identical to
> $Config{'os
54 matches
Mail list logo