On Fri, 10 Aug 2001, Birgit Kellner wrote:
> If I have one script that requires another and I want to make the former's
> global variables available in the latter, and have use strict NOT complain,
> what should I do? Perhaps I should not use "require", but "use"?
IMHO, the proper way to do this
At 08:17 PM 8/10/01 +0530, sachidanand haldankar wrote:
>Hi Peter,
>
>Thanks for ur quick response. Its seems to be working fine. Thanks a
> lot for that. What I am trying to do is to write a Regex for date
> validation in a xml file used in CMS environment(using InterWoven). There
> is a a
Is this to create dynamic web pages using CGI? Or are you trying to run the
perl script to create a static html file from the text file?
John
-Original Message-
From: Thomas Burkhardt [mailto:[EMAIL PROTECTED]]
Sent: 10 August 2001 17:36
To: Perl Help
Subject: skrptX.pl inp.txt--->report
Greetings Perl Gurus!
Problem: Converting text to html using a perl script. I have an
operational perl script that I run on the command line like so:
> skrptX.pl
In the same CWD I have an input file called "inp.txt". Lets say it is
merely a one column list of names. The script I have wr
I am using a script to manage flatfile databases which consists of several
perl files: a central perl script contains all subroutines for data
manipulation, another script prints out html code, and a configuration file
sets all global variables like for instance $db_script_path for the
directo
Are there any equivalent functions for getpwent or getgrent in the NIS
environment? I am able to get the local password information using these
functions. Can they be extended to query the NIS information?
Thanks!
Hello Chasey and Akshay!
> You could use a regex:
>
> $log_line =~ /([\d.]+)\s/;
> my $ip_addr = $1;
> IP numbers have the format ddd.ddd.ddd.ddd ranging from 1 to 3 digits,
> so
> if(/$(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/) would grab the IP and put it
> in $1
> the above will match IP numb
[EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] said:
>
> I didn't find the installation guide for PERL/VMS. The
> Freeware V4 CD does not have anything useful but copies of
> memos dated 1995 and among the 813 files of the 5-003-05
> kit, I only found this which may help, and it actually does not
>
Aaargh Comes from looking at your own code too long. Thanks.
Chris D. Garringer
LAN/WAN Manager
Master Certified Netware Engineer
Microsoft Certified Systems Engineer
Certified Solaris Administrator
Red Hat Certified Engineer
[EMAIL PROTECTED]
fax 713-896-5266
>>> "Bill Odom" <[EMAIL PRO
On Fri, 10 Aug 2001, Michael Wolfrom wrote:
> My question is: How can a match the ^M at the end of a dos text file
> in a regexp?
> What I am trying to do is print all the characters up until the ^M (if
> there is one).
\cM is how you can match it on a regexp. Some people also use \r.
you c
> I don't want to duplicate code. However, system2 has
> two compilers and I need to read each compiler's
> password file and store that data in a hash. Now,
> will the compiler_data hash contain the data for both
> compilers password files? How can I keep them
> separate and don't duplicate c
My question is: How can a match the ^M at the end of a dos text file
in a regexp?
What I am trying to do is print all the characters up until the ^M (if
there is one).
Thanks
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
thanks all! This works, and I am reading Perl cookbook.
-Original Message-
From: Jeff 'japhy/Marillion' Pinyan [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 10:44 AM
To: Jennifer Pan
Cc: [EMAIL PROTECTED]
Subject: Re: grep repetitive elements?
On Aug 10, Jeff 'japhy/Marillio
Chris Garringer [mailto:[EMAIL PROTECTED]] said:
>
> I need to read a Win2k Event log (Application).
> ...
> I got the Win32::Eventlog module and setup per the documentation
> ...
> use Win32::Eventlog;
> ...
> I get a compile-time error
> Can't locate object method new via package
> "Win32::Event
On Aug 10, Jeff 'japhy/Marillion' Pinyan said:
> my %freq;
> $freq{$_}++ for @list2; # create a hash of key -> frequency
>
> for (@list1) {
>print $freq{$_} if $freq{$_} > 1;
> }
Rather,
print $_ if $freq{$_} > 1;
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.
> -Original Message-
> From: Jennifer Pan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 10, 2001 10:20 AM
> To: [EMAIL PROTECTED]
> Subject: grep repetitive elements?
>
>
> I have two list,
> @list1 and @list2, each element @list1 is unique (could be a hash I
> suppose)
>
> I want
On Fri, 10 Aug 2001, Tyler Longren wrote:
> I did:
> print "$scans[0]";
> and nothing is printed...where 192.168.1.1 SHOULD be printed...
> here's what I have:
> open (LOGFILE, $log_file) || die ("Could not open $log_file: $!");
> my @array;
> while () {
> chomp;
> push (@array, $_)
>
On Fri, 10 Aug 2001, Jennifer Pan wrote:
> I have two list,
> @list1 and @list2, each element @list1 is unique (could be a hash I
> suppose)
>
> I want to find out all the elements @list2 that is an element in list1
> and have appeared two or more times
I would break this down algorithmically in
On Aug 10, Jennifer Pan said:
>I have two list,
>@list1 and @list2, each element @list1 is unique (could be a hash I
>suppose)
>
>I want to find out all the elements @list2 that is an element in list1
>and have appeared two or more times
>
>I want to use GREP but I don't know how to grep certain
Ahh...I just started wondering if it stopped at the end of the file...That
should fix it then.
Thank you everyone
On Fri, 10 Aug 2001 09:31:36 -0500
Mooney Christophe-CMOONEY1 <[EMAIL PROTECTED]> wrote:
> I thought so. You read through the entire file, so by the time you get
> to
> your se
On Aug 10, Tyler Longren said:
>while () {
> chomp;
> push (@array, $_)
> if m/ida/i;
>}
>while () {
> push (@scans, $_)
> if m/$last_host/i;
>}
Is there a reason you didn't put both of those into ONE while block? It
would be far more efficient (and it would work).
Th
I thought so. You read through the entire file, so by the time you get to
your second while loop, you're at the very end of the file. You need to
rewind.
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 9:29 AM
To: Brett W. McCoy
Cc: [EMAIL
On Aug 10, Tyler Longren said:
>my @scans;
>my $last_host = "192.168.1.1";
>while () {
> push (@scans, $_)
> if m/$last_host/i;
>}
Your regex matches things like "19271683101". Perhaps you want:
push @scans, $_ if /\Q$last_host\E/;
The /i modifier is useless here, and the \Q...\E
> -Original Message-
> From: Tyler Longren [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 10, 2001 10:19 AM
> To: Perl-Beginners
> Subject: number of elements in array is -1?
>
>
> Hello everyone,
>
> I have a problem. I just want to print the number of elements in an
> array. Here
I did:
print "$scans[0]";
and nothing is printed...where 192.168.1.1 SHOULD be printed...
here's what I have:
open (LOGFILE, $log_file) || die ("Could not open $log_file: $!");
my @array;
while () {
chomp;
push (@array, $_)
if m/ida/i;
}
my $last_host = "192.168.1.1";
my @scans;
well, no, I'm not checking. But it is open correctly because I use it
earlier in the script and it never gets closed until the very end.
On Fri, 10 Aug 2001 09:22:11 -0500
Mooney Christophe-CMOONEY1 <[EMAIL PROTECTED]> wrote:
> if $#scans==-1, then the array is empty (of course!)
>
> Are you
I have two list,
@list1 and @list2, each element @list1 is unique (could be a hash I
suppose)
I want to find out all the elements @list2 that is an element in list1
and have appeared two or more times
I want to use GREP but I don't know how to grep certain element only
when it happens >2 times,
On Aug 10, Jeff 'japhy/Marillion' Pinyan said:
> my $len = length $output;
> my $i = 0;
> while ($i < $len) {
>print substr($output, 8 * $i++, 8), " ";
> }
Oops. The condition of the while loop should be:
while ($i * 8 < $len) { ... }
--
Jeff "japhy" Pinyan [EMAIL PROTECTED]
On Fri, 10 Aug 2001, Tyler Longren wrote:
> I try to show the number of elements in the array like so:
> print "$#scans";
That actually gives the index of the last element, not the actual count
of elements. You want:
print scalar(@scans);
> But that prints "-1". I know for a fact there are a
if $#scans==-1, then the array is empty (of course!)
Are you checking to make sure LOGFILE opened correctly?
-Original Message-
From: Tyler Longren [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 9:19 AM
To: Perl-Beginners
Subject: number of elements in array is -1?
Hello ever
> Is there any function for converting uppercase characters to lowercase
> chars ?
Of course!
perldoc -f uc
perldoc -f lc
perldoc -q capital
-- Brett
http://www.chapelperilous.net/btfwk/
On Aug 10, Hamish Whittal said:
>I have an octet string that I need to print. When I print it, I get some
>rubbish on the screen. I would therefore like to translate this to
>something printable.
>
>e.g I have 11011010110001001011 and I want to print this as 11011010
>1000100 1011
You wa
Hello everyone,
I have a problem. I just want to print the number of elements in an
array. Here's the code:
my @scans;
my $last_host = "192.168.1.1";
while () {
push (@scans, $_)
if m/$last_host/i;
}
shouldn't that put all of the results into the @scans array? I know
there'd just
Try:
print "\L$variable";
This will print the entire string in lowercase.
print "\U$variable";
This will print the entire string in uppercase.
-Original Message-
From: Rahul Garg [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 10, 2001 10:20 AM
To: [EMAIL PROTECTED]
Subject: Is t
On Aug 10, Rahul Garg said:
>Is there any function for converting uppercase characters to lowercase
>chars ?
The lc() function. It returns a lowercased version of the string you pass
it. Please read 'perldoc -f lc'.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~jap
Hello all,
I have an octet string that I need to print. When I print it, I get some
rubbish on the screen. I would therefore like to translate this to
something printable.
e.g I have 11011010110001001011 and I want to print this as 11011010
1000100 1011
Any clews on how to do this?
Tha
Hello,
Is there any function for converting uppercase characters to lowercase chars ?
Thanks
Rahul
I need to read a Win2k Event log (Application). I am running Active State (downloaded
last week) on this machine. I got the Win32::Eventlog module and setup per the
documentation (I think)
use strict;
use Win32::Eventlog;
..
$Win32::Eventlog::GetMessageText=1;
my
$evtflags=$Win32::Eventlog::E
On Fri, 10 Aug 2001, Chris Garaffa wrote:
> I have a few files containing references to 186,000 graphics from Extensis
> Portfolio that I need to import into FileMaker Pro. We've already decided
> the best way is via importing an XML file. I have an idea on how to get
> the data into an XML file
I am using ActiveState perl on Windows NT 4.0 platform. I want to send emails with
attachments. I have downloaded package Sender.pm and copied it to my c:\perl\lib\mail
folder. Do I need to do anything special to install it ?
When I use it in the following script :
use Mail::Sender;
thanks for the explanation. wish i could have received this information from
beginners@perl though. if I can assist you with something
perl/cgi/java/html/dhtml-wise at some given time, I would do so to repay the
favor.
again,
thanks,
John
-Original Message-
From: Dave Newton [mailto:[EMA
Hello Bob,
> I think the answer can be found in the following statement in the persub
> manpage
> under the heading "Private Variables via (my)":
Yes, I read this (sorry for typing error, perlsub should be cited in my
initial message instead of perlvar). Unfortunately, the following
passage
Hi everyone,
I have a few files containing references to 186,000 graphics from Extensis
Portfolio that I need to import into FileMaker Pro. We've already decided
the best way is via importing an XML file. I have an idea on how to get
the data into an XML file and it seems to work (in theory -
Hello Jos,
"Jos I. Boumans" wrote:
>
> let's see if i can shed some light on this.
>
> your statement:
> print("Defined: <<$z>>\n") if defined(my $z="x");
>
> this will be evaluated like this if i'm not mistaken:
> ( print("Defined: <<$z>>\n") ) && defined(my $z="x");
>
> or a simplistic
On Aug 10, Rizwan Majeed said:
>It is known that passing a list by value to a function does not make
>visible to the calling function changes made to the list.
>
>But I dont understand how does the push() function works. Push takes
>the value of a list and still makes visible to the calling block
On Fri, 10 Aug 2001, chris morris wrote:
> I'm sorry I was not clear. Could someone please post an example script of
> a generic opening, reading, and writing to a serial port on a Linux
> system? I'd like to see how to configure the port (baud rate, stop bits,
> etc.) Thanks.
On Linux, I'd use
I'm sorry I was not clear. Could someone please post an example script of
a generic opening, reading, and writing to a serial port on a Linux
system? I'd like to see how to configure the port (baud rate, stop bits,
etc.) Thanks.
-Original Message-
From: Brett W. McCoy [mailto:[EMAIL PROT
> -Original Message-
> From: Cohan, Drew [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 10, 2001 8:32 AM
> To: '[EMAIL PROTECTED]'
> Subject: confused over cookbook example 6-2
>
>
> I'm trying to modify cookbook example 6-2:
>
> #killtags: very bad html tag killer
> undef $/;
> whil
are you sure your input is what you expect it to be?
maybe print out all the lines?
and if you like, i wrote a very basic and simple html parser.
you can get it here: http://japh.nu/index.cgi?base=modules
take a look at the source, it should probably explain a lot
hth
Jos
> I'm trying to modi
nothing
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I'm trying to modify cookbook example 6-2:
#killtags: very bad html tag killer
undef $/;
while(<>){
s/<.*?>//gs;
print;
}
to instead look for all "href=" in an html file across paragraphs/newlines
but I only get the first successful match. why does the cookbook's work but
not mi
> -Original Message-
> From: Ivan Adzhubei [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 10, 2001 7:24 AM
> To: [EMAIL PROTECTED]
> Subject: Scope, priority or bug?
>
>
> Hi!
>
> Isn't this weird?
>
> #!/usr/bin/perl -w
> print("Defined: <<$z>>\n") if defined(my $z="x");
> print "A
let's see if i can shed some light on this.
your statement:
print("Defined: <<$z>>\n") if defined(my $z="x");
this will be evaluated like this if i'm not mistaken:
( print("Defined: <<$z>>\n") ) && defined(my $z="x");
or a simplistic version:
(print $z) && (my $z = 'bar');
try and 'use strict'
Hi,
I'm a new folk in the beginners team.
I didn't find the installation guide for PERL/VMS. The Freeware V4 CD does not
have anything useful but copies of memos dated 1995 and among the 813 files of
the 5-003-05 kit, I only found this which may help, and it actually does not
help at all (and
Hi!
Isn't this weird?
#!/usr/bin/perl -w
print("Defined: <<$z>>\n") if defined(my $z="x");
print "Assigned: <<$z>>\n";
Produces:
Defined: <<>>
Assigned: <>
So it looks like $z *is* defined but *not* assigned until we are out of
the 'if' statement. Is it a bug? My understanding it should eithe
Hi Birgit--
I am probably missing something, but the thing I see is that you have
used the my keyword inside your loop in this statement:
> my @db_cols = @cols; # now we set the field names to those of db2
which we
> my ($status2, @hits2) = &query('view'); # sub query does the actual
search
tha
On Fri, Aug 10, 2001 at 10:42:32AM +0500, Rizwan Majeed wrote:
> It is known that passing a list by value to a function does not make
> visible to the calling function changes made to the list.
That isn't necessarily true. The code:
sub my_push (\@@) { push(@{ $_[0] }, @_[1 .. $#_]) }
On Fri, Aug 10, 2001 at 12:11:43AM -0500, Teresa Raymond wrote:
> If you don't have the access to install a module in the root
> directory, this is the way you can do it - unless you ask the web
> host to install the module you want specifically.
I was talking about installing the module in a u
58 matches
Mail list logo