I think this is what the OP was looking for:
if(/^(everywhere|nowhere)/){
do something...
}
-Original Message-
From: Toby Stuart [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 9:01 PM
To: '[EMAIL PROTECTED]'
Cc: '[EMAIL PROTECTED]'
Subject: RE: Using alternatives and ancho
This is because you don't have to define your functions in Perl like you do
in C or some other languages. Perl does have the ability to declare
function prototypes, but this is generally not used. If you wanted to
declare a function prototype, I believe you would have to declare it earlier
in you
"Shawn Bower" <[EMAIL PROTECTED]> wrote in message
001301c2d3de$5093d020$6401a8c0@Beast">news:001301c2d3de$5093d020$6401a8c0@Beast...
> I'm trying to write a script that will open a socket connection to a
> website and return a gif. I got it working to the point where and send
> the request and r
Hi,
i have a script with multi files...
in one file, i defined all the functions..
and from other file i am calling the functions...
suppose, following is my function defination...
sub log_msg()
{
print LOG "@_\n";
}
i am calling this function with
log_msg("Running script\n")
here i
> -Original Message-
> From: brady jacksan [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 18, 2003 3:50 PM
> To: [EMAIL PROTECTED]
> Subject: Using alternatives and anchors
>
>
>
> I am writing a script that will read from a file named
> myfiles not stdin and print the lines co
I am writing a script that will read from a file named myfiles not stdin and print
the lines containing the following words "everywhere" or 'nowhere.
#!/usr/bin/perl
#use strict
while (<>) {
chomp;
if (/^everywhere$|^nowhere$/)
print
}
How do I invoked the file myfiles at the begi
How about you just force a logoff then instead of trying to find the window?
-Original Message-
From: Jangale V-S [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 17, 2003 8:15 PM
To: 'Timothy Johnson'
Subject: RE: killing a process by window title; was: socket application
No ! It's no
"R. Joseph Newton" wrote:
>
> Dan Muey wrote:
>
> > IS there a better way to perhaps assign the value of $1 back to $var all in one
>statement?
> > EG
> >
> > $var = 'hello.domain.com';
> > # Instead of this ::
> > $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> > $var = $1; # then
> Use of uninitialized value at Audit_WTN.pl line 133,
> chunk 19.
>
> how to avoid warning at following location
> 133 if ( $ret >= 1 ) {
Try
if ( ($ret||0) >= 1 ) {
If $ret is uninitialized, the || will pass to the 0 and return that.
Better to check your situation more carefully
Dan Muey wrote:
> IS there a better way to perhaps assign the value of $1 back to $var all in one
>statement?
> EG
>
> $var = 'hello.domain.com';
> # Instead of this ::
> $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> $var = $1; # then $var becomes 'domain.com'
> # Perhaps a one lin
--- Bernhard van Staveren <[EMAIL PROTECTED]> wrote:
> I guess our definitions of unreadable differ in that case; I have my
> style of writing things, you have yours - and such is life.
That's pretty common. A guy in our office prefers:
my $doc = "\n";
$doc .= "\tThe various lines of text hi
Hi,
I have following script, basically this will
ding the duplicate rows in a file...
I am getting following warnings
Use of uninitialized value at Audit_WTN.pl line 133,
chunk 18.
Use of uninitialized value at Audit_WTN.pl line 133,
chunk 19.
how to avoid warning at following location
13
> Well, any other ideas on how I can have a hundred scripts all use the
> same settings and make it easy to change any of them at will without
> having to go edit a hundred files would be nice.
> ...
> To share configuration variables in one place for lots and lots of
> scripts to use instead of h
Dan Muey wrote:
>
> To share configuration variables in one place for lots and lots of scripts to use
>instead of having to put them in each script and then on echanges and having to go
>through a hundred scripts all over the place to change them.
>
> Someone else already helped me get it nailed
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > $domain =~ m/((\w+)\.(\w+)$)/;
> > And $1 did indeed only have 'domain.com'
> > Then I realized, what about tld's like com.uk like yahoo.com.ru
> > google.com.uk
>
> Try
>
> my($dom) = $URI =~ m{://([^/:]+)};
>
> If $URI =
> "http://some.server.
I guess our definitions of unreadable differ in that case; I have my style
of writing things, you have yours - and such is life.
The extra spaces get on my tits pretty much, and it's perfectly readable
without it, IMHO.
On Mon, 17 Feb 2003, R. Joseph Newton wrote:
> HI Bernard,
>
> Quick and Dir
>
> Dan Muey wrote:
>
> > I guess my main question would boil down to ::
> >
> > How can I use variables that get declared in a lib file in a script
> > that uses -w and use strict; ?
> >
> > A more complex example of what I've tried and what I'm
> trying to get
> > is here ::
> >
> > On the
Thanks!
>
> Dan Muey wrote:
> >
> > IS there a better way to perhaps assign the value of $1
> back to $var
> > all in one statement?
>
> Yes.
>
> > EG
> >
> > $var = 'hello.domain.com';
> > # Instead of this ::
> > $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> $var = $1;
>
Dan Muey wrote:
> I guess my main question would boil down to ::
>
> How can I use variables that get declared in a lib file in a script that uses -w and
>use strict; ?
>
> A more complex example of what I've tried and what I'm trying to get is here ::
>
> On the script below, when use strict is
Dan Muey wrote:
>
> IS there a better way to perhaps assign the value of $1 back to $var all in one
>statement?
Yes.
> EG
>
> $var = 'hello.domain.com';
> # Instead of this ::
> $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> $var = $1; # then $var becomes 'domain.com'
> # Perhaps
>
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > IS there a better way to perhaps assign the value of $1
> back to $var
> > all in one statement? EG
> >
> > $var = 'hello.domain.com';
> > # Instead of this ::
> > $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> $var = $1;
> > #
--- Dan Muey <[EMAIL PROTECTED]> wrote:
> $domain =~ m/((\w+)\.(\w+)$)/;
> And $1 did indeed only have 'domain.com'
> Then I realized, what about tld's like com.uk like yahoo.com.ru
> google.com.uk
Try
my($dom) = $URI =~ m{://([^/:]+)};
If $URI = "http://some.server.com.uk:1540/other/stiff.cgi
--- Dan Muey <[EMAIL PROTECTED]> wrote:
> IS there a better way to perhaps assign the value of $1 back to $var
> all in one statement?
> EG
>
> $var = 'hello.domain.com';
> # Instead of this ::
> $var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
> $var = $1; # then $var becomes 'domain.c
IS there a better way to perhaps assign the value of $1 back to $var all in one
statement?
EG
$var = 'hello.domain.com';
# Instead of this ::
$var =~ m/((\w+)\.(\w+)$)/; # $1 then becomes 'domain.com'
$var = $1; # then $var becomes 'domain.com'
# Perhaps a one liner version?
I know there's a way
> Hello,
>
> Does anyone know of a quick/easy/fast way to to get the
> domain out of a url?
>
> For instance if I do : $url = $cgi->url();
>
> I'll get, say http://joe.mama.com/so/isyour.cgi?mother
>
Here's a partial answer to my own question ::
$uri = URI->new($cgi->url());
$domain =
> > > > use vars '$dog';
>
> > Personally, because I like typing 2 letters instead of 7. :)
>
> Ok then if your Perl (>5.6.0) allows it, change the above to:
>
> our $dog;
>
> perldoc vars
> perldoc -f our
>
> Save 7 more characters... ;-)
lol -- sweet.
I'm still trying to get used to our().
Just for fun, a functional but BAD example
use FileHandle;
@_ = map { new FileHandle $_ } @ARGV;
print while $_ = join "\t", map(scalar<$_>||'',@_), "\n"
and s/\n(.)/\t$1/g;
Okay, that's ugly and almost completely unmaintainable for LOTS of
reasons, but it works. It will even
Marco Giardina wrote:
> Hi list,
>
> sorry but i'am a newbie about Perl. Perl is fantastic, anything is possible
> when use Perl..
> So i have a question about this language. In brief I'll modify some
> information inside a file, for example image a file test.conf.
> I'll erase some character (#)
On Mon, 17 Feb 2003 11:45:15 -0800 (PST), Paul <[EMAIL PROTECTED]> wrote:
> > > --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > > use vars '$dog';
> Personally, because I like typing 2 letters instead of 7. :)
>
Ok then if your Perl (>5.6.0) allows
Right on thanks!
>
> > > --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > > > #!/usr/bin/perl -w
> > > > use strict;
> > > > #my $dog = 'bart';
> > > > eval {
> > > > use lib '/home/dmuey';
> > > > require "lib.lib";
> > > > };
> > > > print "Content-type: text/html\n\n";
> > > > prin
> > --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > > #!/usr/bin/perl -w
> > > use strict;
> > > #my $dog = 'bart';
> > > eval {
> > > use lib '/home/dmuey';
> > > require "lib.lib";
> > > };
> > > print "Content-type: text/html\n\n";
> > > print "Error: $@ :: $dog ::\n";
> > >
> > > :
HI Bernard,
Quick and Dirty is one thing. Unreadable is another. Perl allows spaces to be used
freely. The programmer who ishes to keep track of what his or her code is doing will
use them.
use strict;
open (FONE, $ARGV[0]);
open (FTWO, $ARGV[1]);
open (FOUT, ">$ARGV[2]");
my @f1;
my @f2;
>
> --- Dan Muey <[EMAIL PROTECTED]> wrote:
> > #!/usr/bin/perl -w
> > use strict;
> > #my $dog = 'bart';
> > eval {
> > use lib '/home/dmuey';
> > require "lib.lib";
> > };
> > print "Content-type: text/html\n\n";
> > print "Error: $@ :: $dog ::\n";
> >
> > :: lib.lib file is ::
Id' try searching on mysql.com .
Also just from experience mysql is an extremely reliable, workhorse of a system.
In fact I found a link on mysql's site that had an article from some big database
conference recently that said that on the tests they ran, only Oracle and Mysql
passed/had similar
--- Madhu Reddy <[EMAIL PROTECTED]> wrote:
> Hi,
> I want to put MFILE=mdl_data.txt in ENV and want to
> access later..
> i am trying following...I am getting error...
> system(`MFILE=mdl_data.txt`);
> $k6 = "MFILE";
> $key6 = $ENV{$k6};
> print "$key6 \n";
> how to do this ?
The system() call
Does anyone know of a good resource that compares MySQL for windows to
the other popular engines?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] On Behalf Of
Chris Jones
Sent: Monday, February 17, 2003 11:57 AM
To: Pradeep Goel; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTE
--- Dan Muey <[EMAIL PROTECTED]> wrote:
> #!/usr/bin/perl -w
> use strict;
> #my $dog = 'bart';
> eval {
> use lib '/home/dmuey';
> require "lib.lib";
> };
> print "Content-type: text/html\n\n";
> print "Error: $@ :: $dog ::\n";
>
> :: lib.lib file is ::
>
> my $dog = 'joe';
> 1;
Hi,
I want to put MFILE=mdl_data.txt in ENV and want to
access later..
i am trying following...I am getting error...
system(`MFILE=mdl_data.txt`);
$k6 = "MFILE";
$key6 = $ENV{$k6};
print "$key6 \n";
how to do this ?
Thanx
-Madhu
__
Do you Yah
I guess my main question would boil down to ::
How can I use variables that get declared in a lib file in a script that uses -w and
use strict; ?
A more complex example of what I've tried and what I'm trying to get is here ::
On the script below, when use strict is commented out ::
Name "main::
Hello,
Does anyone know of a quick/easy/fast way to to get the domain out of a url?
For instance if I do : $url = $cgi->url();
I'll get, say http://joe.mama.com/so/isyour.cgi?mother
I know I can use URI module to get the scheme (http, https, ftp, etc) from that
What I need to grab out of
Zysman, Roiy wrote:
> Hi all,
> Does anybody know of a perl _ncurses_ module ? .
> I saw some _curses_ modules at cpan but not ncurses.
The Curses module on CPAN will detect and use your ncurses libraries.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTE
If the programs you are using are perl scripts then it is likely that you
can run them directly on Windows without CYGWIN. Depending on the size of
the database file and how you want to use it, you might consider MySQL -
open source, fast database.
Hi All
I have no idea of CYGWIN except o
> file_1:
> 12
> 13
> 14
> 3
>
> file_2:
> 3
> 45
> 34
> 56
A real quick and dirty way of doing it:
-- 8< --
use strict;
open(FONE, $ARGV[0]);
open(FTWO, $ARGV[1]);
open(FOUT, ">$ARGV[2]");
my @f1;
my @f2;
my $c=0;
chomp(@f1=);
chomp(@f2=);
close(FONE);
close(FTWO);
for($c=0;$chttp://www.gho
Okay, so here's what I need to do:
1. Receive a request to a given URI, X
2. Based on that URI, change certain values with the request
(e.g. change the names or values of variables posted by the user,
modify the "x-www-form-urlencoded" data, whatever...)
3. Translate the UR
--- [EMAIL PROTECTED] wrote:
> Paul <[EMAIL PROTECTED]> wrote:
> > Felix Geerinckx <[EMAIL PROTECTED]> wrote:
> > > [EMAIL PROTECTED] (Jc) wrote:
> > > > How would such a thing be done with Perl?
> > > You may want to take a look at O'Reilly's "Mastering Algorithms
> > > with Perl", by Jon Orwant
On Mon, 17 Feb 2003 07:21:23 -0800 (PST), Paul <[EMAIL PROTECTED]> wrote:
>
> --- Felix Geerinckx <[EMAIL PROTECTED]> wrote:
> > on Sun, 16 Feb 2003 18:29:23 GMT, [EMAIL PROTECTED] (Jc) wrote:
> > > How would such a thing be done with Perl? This
--- Bryan Harris <[EMAIL PROTECTED]> wrote:
> >> I'd like to concatenate two variables--
> >> $newVar = $old1 . $old2;
> >> -- where $old1 might be undefined. Is there any way to set a flag
> >> so that this just results in $old2 instead of the compiler
throwing
> >> an error?
> >
> > The concate
--- Pradeep Goel <[EMAIL PROTECTED]> wrote:
> Hi All
> I have no idea of CYGWIN except only that almost all unix commands
> can be run on windows .
> I want to know if the SAME program running on unix systems can be run
> on windows without any change ( or otherwise what changes need to be
> ma
see Tie::File
--- Marco Giardina <[EMAIL PROTECTED]> wrote:
>
> Hi list,
>
>
> sorry but i'am a newbie about Perl. Perl is fantastic, anything is
> possible
> when use Perl..
> So i have a question about this language. In brief I'll modify some
> information inside a file, for example image
--- Felix Geerinckx <[EMAIL PROTECTED]> wrote:
> on Sun, 16 Feb 2003 18:29:23 GMT, [EMAIL PROTECTED] (Jc) wrote:
> > How would such a thing be done with Perl? This may help me
> > understand C's version a little better.
> You may want to take a look at O'Reilly's "Mastering Algorithms with
> Per
That should have been:
Not all *nix programs will run under Cygwin because some require *MORE*
services/libraries than Cygwin provides
Sorry about that...
jpt
> -Original Message-
> From: Tillman, James
> Sent: Monday, February 17, 2003 9:53 AM
> To: 'Pradeep Goel'; [EMAIL PROTECTED]
>
a small possibility -- -e just makes sure it exists. Try testing the
size if it does.
if (-f $file and -s _) {
--- Patricia Hinman <[EMAIL PROTECTED]> wrote:
> Everything "was" perfect in my little program. I gave
> it a test run today. My file which copies some
> demofiles is sending blank
> "JC(oesd)" wrote:
> I just had a friend explain in some little detail about linked
> lists in C using structures.
> How would such a thing be done with Perl?
> This may help me understand C's version a little better.
The idea is simply to have one thing tell you where the next thing is
in a pref
> -Original Message-
> From: Pradeep Goel [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 17, 2003 8:34 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: 1) cygwin , 2) sprite/DBM
>
>
> Hi All
>
> I have no idea of CYGWIN except only that almost all unix
> commands c
Aimal Pashtoonmal wrote:
> Dear folks,
>
> I have 2 files each contain a column of data, I want to combine them
> into 1 file with the 2 columns next to each other, eg:
>
> file_1:
> 12
> 13
> 14
> 3
>
> file_2:
> 3
> 45
> 34
> 56
>
> desired output:
>
> 12 3
> 13 45
> 14 34
> 3 56
Ther
Rob Dixon wrote:
> Bryan Harris wrote:
> > > > I'd like to concatenate two variables--
> > > >
> > > > $newVar = $old1 . $old2;
> > > >
> > > > -- where $old1 might be undefined. Is there any way to set a
> > > > flag so that this just results in $old2 instead of the compiler
> > > > throwing an e
Bryan Harris wrote:
> > > I'd like to concatenate two variables--
> > >
> > > $newVar = $old1 . $old2;
> > >
> > > -- where $old1 might be undefined. Is there any way to set a
> > > flag so that this just results in $old2 instead of the compiler
> > > throwing an error?
> >
> > The concatenation o
Marco Giardina wrote:
>
> Hi list,
Hello,
> sorry but i'am a newbie about Perl. Perl is fantastic, anything is possible
> when use Perl..
> So i have a question about this language.
In fact it is a Frequently Asked Question (FAQ.)
> In brief I'll modify some
> information inside a file, for ex
Aimal Pashtoonmal wrote:
>
> Dear folks,
Hello,
> I have 2 files each contain a column of data, I want to combine them
> into 1 file with the 2 columns next to each other, eg:
>
> file_1:
> 12
> 13
> 14
> 3
>
> file_2:
> 3
> 45
> 34
> 56
>
> desired output:
>
> 12 3
> 13 45
> 14 34
>
From: Bryan Harris <[EMAIL PROTECTED]>
> I'd like to concatenate two variables--
>
> $newVar = $old1 . $old2;
>
> -- where $old1 might be undefined. Is there any way to set a flag so
> that this just results in $old2 instead of the compiler throwing an
> error?
It's not an error, but a warning.
From: "Pradeep Goel" <[EMAIL PROTECTED]>
> I have no idea of CYGWIN except only that almost all unix commands
> can be run on windows .
>
> I want to know if the SAME program running on unix systems can be run
> on windows without any change ( or otherwise what changes need to be
> made) after
ok, thanks.
On Mon, 2003-02-17 at 07:54, Felix Geerinckx wrote:
> on Mon, 17 Feb 2003 13:37:57 GMT, [EMAIL PROTECTED] (Joe Mecklin)
> wrote:
>
> > Thanks for the info. I appreciate the ideas. Seeing your
> > response, I obviously didn't phrase my request as well as I could
> > have:
> >
> >
The Win32::NetResource Module will let you mount remote share
use Win32::NetResource;
use strict;
use warnings;
my$RemoteShare = {
'LocalName' => "Q:",
'RemoteName' => "server\\share",
};
my $UserName = "user";
my $Password =
on Mon, 17 Feb 2003 13:37:57 GMT, [EMAIL PROTECTED] (Joe Mecklin)
wrote:
> Thanks for the info. I appreciate the ideas. Seeing your
> response, I obviously didn't phrase my request as well as I could
> have:
>
> I'm looking for a Perl module for Linux that allows "net use"
> functionality; do
Mat Harris wrote:
On Mon, Feb 17, 2003 at 05:34:23 +0530, Ramprasad wrote:
talk about reinventing the wheel :-O
Now when you have an excellent tool like squid why would anyone go to
write his own proxy
I want to be able to use a php webpage to authenticate the user to make it
as transparen
>> I'd like to concatenate two variables--
>>
>> $newVar = $old1 . $old2;
>>
>> -- where $old1 might be undefined. Is there any way to set a flag so
>> that this just results in $old2 instead of the compiler throwing an
>> error?
>
> The concatenation operator will work fine with an undefined
Jenda,
Thanks for the info. I appreciate the ideas. Seeing your response, I
obviously didn't phrase my request as well as I could have:
I'm looking for a Perl module for Linux that allows "net use"
functionality; does anyone know if such a module exists? I believe what
is presented here is mea
Hi All
I have no idea of CYGWIN except only that almost all unix commands can be
run
on windows .
I want to know if the SAME program running on unix systems can be run on
windows without any change ( or otherwise what changes need to be made)
after installing cygwin .
in both cases ( unix & w
From: Joe Mecklin <[EMAIL PROTECTED]>
> I'm tying to write a script which will connect to all PCs in an
> internal network to update select files. I currently have it working
> using
>
> system("net use ...")
>
> but I would like to use whatever module will replicate that
> connection/login/log
I tried sending this last week and never saw it or any response to it on the list,
so I'll try again:
I'm tying to write a script which will connect to all PCs in an internal
network to update select files. I currently have it working using
system("net use ...")
but I would like to use whatev
On Mon, Feb 17, 2003 at 05:34:23 +0530, Ramprasad wrote:
> talk about reinventing the wheel :-O
>
>
> Now when you have an excellent tool like squid why would anyone go to
> write his own proxy
>
I want to be able to use a php webpage to authenticate the user to make it
as transparent as possi
[snip]
> Is there anything in particular in a script, that would cause this type of
> error?? Any suggestions or areas to look at, would be greatly appreciated.
If you're seeing "out of memory" in the Apache logs, first thing to look for
is recursive loops inside the script. However if it doesn
Hi list,
sorry but i'am a newbie about Perl. Perl is fantastic, anything is possible
when use Perl..
So i have a question about this language. In brief I'll modify some
information inside a file, for example image a file test.conf.
I'll erase some character (#) before a line and then eventuall
Dear folks,
I have 2 files each contain a column of data, I want to combine them
into 1 file with the 2 columns next to each other, eg:
file_1:
12
13
14
3
file_2:
3
45
34
56
desired output:
12 3
13 45
14 34
3 56
chrs, amal.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For ad
Mat Harris wrote:
i am trying to write a mini proxy server to authenticate and run some other
checking on http requests before they are passed to a squid server.
I have got the following program which works for very basic requests but
cannot deal with forms or anything complex.
I will detail the
Bryan Harris wrote:
> I'd like to concatenate two variables--
>
> $newVar = $old1 . $old2;
>
> -- where $old1 might be undefined. Is there any way to set a flag so
> that this just results in $old2 instead of the compiler throwing an
> error?
The concatenation operator will work fine with an unde
Jc wrote:
> I just had a friend explain in some little detail about linked lists
> in C using structures.
>
> How would such a thing be done with Perl? This may help me
> understand C's version a little better.
>
> If you need more information than this, I can provide it...I think :)
Yes, more in
I'd like to concatenate two variables--
$newVar = $old1 . $old2;
-- where $old1 might be undefined. Is there any way to set a flag so that
this just results in $old2 instead of the compiler throwing an error?
(This is a gross simplification of the problem, I'd rather not check to see
if it's
Jim,
Some time ago a Computer Sci student was working on Linked Lists and
posted some code she needed help with.
> How would such a thing be done with Perl?
Preuse, run, modify and complete this code (it needs a way to remove a
center link, amoung other things.
I don't take credit for this code
Hi all,
Does anybody know of a perl _ncurses_ module ? .
I saw some _curses_ modules at cpan but not ncurses.
Thanks,Roiy
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
80 matches
Mail list logo