On 08/11/2006 11:50 PM, [EMAIL PROTECTED] wrote:
Hi John,
Thanks for a very quick response John.
It gives the error as below:
Trailing \ in regex m/D:\STUDY\PERL\MYFTP\/ at
D:\Study\Perl\MyFtp\Ftp1.pl line
109.
($base,$path,$type) = fileparse($ARGV[0]);
$pattern=$path;
print matches if
On 08/10/2006 09:12 AM, Roman Daszczyszak wrote:
Hello all,
I have several text files with a few thousand contacts in each, and I
am trying to pull out all the contacts from certain email domains
(about 15 of them). I wrote a script that loops through each file,
then loops through matching
On 08/09/2006 11:15 AM, Octavian Rasnita wrote:
Hi,
I have a program that contains a pretty big block of text:
my $text = EOF;
line1
line2
...
line 12
EOF
I want to read this block of text line by line and analyse each line without
needing to create a big array that contains all these
On 08/07/2006 06:57 PM, Ryan Dillinger wrote:
Hello All,
I just recently loaded linux onto my laptop. I hope this was not a bad
move.
But I cannot find the Activstate Perl I downloaded.I am using openSUSE
Linux.
I also am having trouble deciding which is the command line to open my
scripts.
On 08/08/2006 04:19 AM, Gary Stainburn wrote:
[ snipped ]
What's the best way to force the formatting similar to the original layout?
Did you read the perlpod document (perldoc perlpod)? Did you
read Ken Foskey's response in the thread?
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
On 08/08/2006 12:12 PM, n[ate]vw wrote:
I'm having some trouble using a hash of arrays. I thought I was starting
to understand the jumbled mass of variable use in Perl, but perhaps not...
Instead of the missing switch() statement, I'm using a hash set up like
this:
%zone_info = (
'EST' =
On 08/07/2006 03:12 AM, Ryan Perry wrote:
I have a string I want to pass to another function and I want that
function to evaluate it as perl code:
[...]
perldoc -f eval
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On 08/06/2006 01:15 AM, Saurabh Singhvi wrote:
Hi all
[...]
Hello
use lwp::UserAgent;
[...]
I am using the above code to submit a form. Is it correct ?? I can't
test it
as I am behind proxy. So I need a way
make the code do the requests through a proxy. The $ variables are being
passed
On 08/06/2006 09:43 PM, Ralph H. Stoos Jr. wrote:
[...]
So, what I really want, is to have the script re-entrant so that I can
get one file as output, and then use all the resultant files as a base
to further parse.
Pardon my blathering explanation, but can I do this ?? Do I need to
make
On 08/04/2006 02:25 PM, Wesley Bresson wrote:
Thanks for your example script using HTML::Treebuilder, however I'm
trying to figure out why it appears to grab some items but not others.
[...]
What appears to grab some items but not others? You didn't
show anyone your program, so how can
On 08/04/2006 05:07 AM, [EMAIL PROTECTED] wrote:
Hi List,
[...]
Hi Web.
Maybe someone has a hint how to convert a XML::Simple document (by POST) in
UTF-8 with the FLAG set on to a Simple LATIN1 document so that I can safe it
into my latin1 table!
Tanks for any help
Ciao Thomas
On 08/04/2006 04:36 PM, Denzil Kruse wrote:
I want to see the results of a top command through my
web browser, but when I try this with my cgi script:
my $output = `top`;
print $output;
I get this error:
top: Unknown terminal VT100 in $TERM
Is there a way to tell top which terminal i'm
On 08/04/2006 04:26 AM, Paul Beckett wrote:
I'm trying to pattern match the beginning of a SQL string like:
INSERT INTO `rwikiobject` VALUES
('0b5e02f308c5341d0108fca900670107','2006-03-06
23:36:41','/site/ec07580d-1c66-469f-80be-c0afd616cedf/alembert, d
On 08/03/2006 01:27 PM, Wesley Bresson wrote:
I'm pretty new to Perl, my past experience has been in modifying other
peoples code in order to do what I want it to do but now I'm trying to
write
my own to do a specific task that I can't find code for and am having
issues. I am trying to
On 08/03/2006 10:58 AM, Tim Wolak wrote:
Hi All,
I'm working on a bit of code to parse a logfile, grab the IP's and put
them in the deny file. In the beginning of my code I'm grabbing all the
IP's in the deny file, putting them in an array to check against later
to make sure that IP is not
On 08/03/2006 07:37 PM, Eric Krause wrote:
Hello all,
I am new to perl and I am trying to write a script that will allow me to
automate some tasks that I do every day on the same web pages. Can
anyone give me some quick examples to get web page data and pass data
back to the pages?
Sorry if
On 08/02/2006 10:39 AM, Sayed, Irfan (Irfan) wrote:
Hi All,
Following is the code which i am executing but i am not getting the
output of command my $out = system($cmd); into the file.
Plz help.
Regards
Irfan.
#/usr/atria/bin/Perl -w
use strict;
use warnings;
my $CT =
On 08/01/2006 08:13 AM, Dr. Claus-Peter Becke wrote:
databaserequest_noun($col, $table, $case) is a self written function
based on the dbi manual's proposals. here's the code:
sub databaserequest_noun {
my ($col,$table,$case) = @_;
my $database = lexikon;
my $hostname = localhost;
my $dsn =
On 07/31/2006 03:45 AM, Dr. Claus-Peter Becke wrote:
dear members,
using a subroutine's resulting argument in an if-clause i compare this
string with another term. but although each of the term has the value of
the other i don't achieve the result i'm looking for.
if (($Q::partofspeech eq
On 07/31/2006 11:29 AM, Dr. Claus-Peter Becke wrote:
Mumia W. schrieb:
On 07/31/2006 07:20 AM, Dr. Claus-Peter Becke wrote:
dear mumia w,
thank for your support. as you supposed the values aren't equal. the
subroutine's argument is 1. had databaserequest_noun been
interpreted in scalar
On 07/28/2006 02:25 AM, Nath, Alok (STSD) wrote:
Ramnish,
Here's my Hello World Cgi script which I am trying to run
#!/usr/bin/perl
print Content-type: text/html\n\n;
print Hello, World.;
It has no problem.
[...]
When apache encounters an error, it records it in its
error.log. What
On 07/28/2006 06:46 AM, Nath, Alok (STSD) wrote:
From: Ranish George [EMAIL PROTECTED]
Hi Alok,
Have you tried changing the shebang line as I have mentioned in
one of the follow up. Trying changing the shebang to
#!C:\Perl\bin\perl
-Ranish George
Ramnish,
I have tried
On 07/28/2006 03:01 PM, Jeremy Kister wrote:
perldoc -q quote talks about \Q before a regex to escape special
characters.
how do you use \Q when you want to anchor the regex with a dollar sign ?
my $string = my $regex = foo;
print match\n if($string =~ /^\Q${regex}$/);
\E enables normal
On 07/27/2006 09:20 AM, Sayed, Irfan (Irfan) wrote:
Hi All,
I need to send / print / write the output of one command to a file
through perl script
can anybody plz help.
Regards
Irfan.
The Perl documentation which you've already read shows you how
to do this. As reminders, look
On 07/25/2006 10:07 PM, Mumia W. wrote:
On 07/25/2006 08:32 PM, macromedia wrote:
Hi,
I can't seem to get my script to sort properly. Below is my code [...]
sort { $a-[0] cmp $b-[0] || $a-[7] = $b-[7] }
[...]
Cmp does string comparisons. Use = for numeric
comparisons. Read
On 07/25/2006 08:32 PM, macromedia wrote:
Hi,
I can't seem to get my script to sort properly. [...]
Here is a shortened version of your program:
use strict;
use warnings;
use File::Slurp;
my %tags;
foreach my $line (read_file 'sort_tags.dat') {
if ($line =~ m/id=(\d*)([[:alpha:]]*)/) {
dereference string. Once I
put that item in place, I started seeing output.
Thanks for all your assistance.
You're welcome.
--- Mumia W. [EMAIL PROTECTED]
wrote:
That's an attribution.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
On 07/26/2006 02:59 PM, Steve Pittman wrote:
I am using activestate on a windows box ...the files I am parsing are
Unix files...I tried this so far...
open ( IN, $_[0] )||die Can't open DAT source file: $tempFile
$!\n;
while (IN){s/\r/\n/g;@lines = IN;}#
close (IN);
On 07/26/2006 02:44 PM, BW wrote:
I'm not sure that I was completely clear on my
description. As I go through the Dumper output, I
have a different name/entry for each occurence of the
{changing element name} element. I'm looking for
recommendations regarding how to handle such
occurrences.
On 07/25/2006 10:49 AM, brian bwarn wrote:
Thank you both for your replies. I'm still not having
success with either Venkat's or Mumia's version of the
foreach loop. [...]
Did you enable ForceArray?
Did you use Data::Dumper to look at the structure of what
XML::Simple returned?
--
To
On 07/25/2006 03:36 PM, BW wrote:
Mumia W. wrote:
Did you enable ForceArray?
Did you use Data::Dumper to look at the structure of
what XML::Simple returned?
Yes to both. I've attached the Dumper output.
(outp.txt). Given the attached xml file, and your
first snippet/example, I tried to do
On 07/25/2006 02:23 PM, siegfried wrote:
I have some cron jobs running perl for many hours. Sometimes I would like to
control things dynamically or even shutdown the job if I notice it is not
running properly (based on the log files).
Below is what I am doing presently (inside a loop) and I
On 07/25/2006 08:32 PM, macromedia wrote:
Hi,
I can't seem to get my script to sort properly. Below
is my code [...]
sort { $a-[0] cmp $b-[0] || $a-[7] = $b-[7] }
[...]
Cmp does string comparisons. Use = for numeric
comparisons. Read perldoc perlop.
--
To
On 07/24/2006 11:40 AM, Ryan Moszynski wrote:
Is there a way to make my commented 'foreach line act the same as the
line above it?
[...]
foreach (0..10,33..43,100..111){
#foreach ($list4){
[...]
Use the split function to split $list4 on the commas. Read
about split: perldoc -f split
On 07/24/2006 12:12 PM, Mumia W. wrote:
On 07/24/2006 11:40 AM, Ryan Moszynski wrote:
Is there a way to make my commented 'foreach line act the same as the
line above it?
[...]
foreach (0..10,33..43,100..111){
#foreach ($list4){
[...]
Use the split function to split $list4
On 07/24/2006 06:35 PM, Nishi Bhonsle wrote:
Hi:
If I need to get the files without the . and the .. at the first level
only, [...]
use File::Slurp;
my @files = read_dir('mydirectory');
Do you have the perl documentation installed?
This should give you information about File::Slurp:
perldoc
On 07/24/2006 04:59 PM, brian bwarn wrote:
I'm just starting out with XML::Simple and can't get
any output to display to STDOUT. What am I missing?
---
Source XML snippet:
---
[snipped]
Use the ForceArray option to make traversal easier. Use
Data::Dumper to
On 07/20/2006 07:07 PM, Alan Campbell wrote:
ello folks,
...got a bit carried away with references deeply nested structures. Net result is I have an array of the form: -
$ref- reference to nested array
[0] - nothing
On 07/21/2006 01:24 AM, Sayed, Irfan (Irfan) wrote:
Hi,
I need to read a specific file and put the each line of
that file into an array.
I mean first line will go to the first position of the
array , second line [should] go to the second position of the
array and so on.
How do i do that ?
On 07/21/2006 02:08 PM, Jerry DuVal wrote:
When trying to use the class below I keep getting this error message. Any
idea's, I have tried everything.
Can't use an undefined value as a HASH reference at
/usr/share/perl5/Pace/Sockets/Client.pm line 37.
[...]
sub start1
On 07/21/2006 03:14 PM, [EMAIL PROTECTED] wrote:
How do I pass an array to a subroutine in a manner that the array is entirely
contained in one element of @_, instead of having each element mapped to
elements of @_.
for example, inside of the subroutine, I'd like to say
@z = @_[0];
and have
On 07/20/2006 05:09 AM, Shane Calimlim wrote:
I'd like to add some sub routines to the global namespace.
I know this is usually considered bad design for modules,
but I intend to do this only for a personal project. I'd
just like to know if this is possible, and how. And if so,
using pure perl
On 07/19/2006 05:04 AM, Ken Perl wrote:
ok, let me explain what I mean.
$account = new Account;
then I can get the currency of the two countries,
$account-currency_us;
$account-currency_fr;
after I freeze the code, a new country jumps out, suppose i need
support Iraq, but now I can't use this,
On 07/19/2006 02:57 AM, Sayed, Irfan (Irfan) wrote:
Hi,
I need to split following string
cs_backup_restore_cmvobsvr1mum
the output which i am looking for is
cs_backup_restore and _cmvobsvr1mum
can anybody plz help
regards
irfan.
Sayed, Irfan; your questions are too basic. Any
On 07/14/2006 06:04 PM, Ryan Moszynski wrote:
Mumia,
thanks for your work on answering my help request. I really
appreciate it. However, while your solution works perfectly in your
sample program, since I am new to perl, I am having trouble
understanding some of the techniques you used, and i
On 07/14/2006 06:04 PM, Ryan Moszynski wrote:
Mumia,
thanks for your work on answering my help request. [...]
You're welcome.
how do i get all of this inside my if statement? [...]
Here's another example:
my @data = ('1-10;25;33;100-250', '1-10;25;33;x100-250',
On 07/13/2006 12:47 AM, Dr.Ruud wrote:
Mumia W. schreef:
$str =~ m/^((\d+-\d+|\d+);?)+$/g;
However, this does not consider 250-100 to be invalid.
Nor 10-30-20.
What's the g-modifier for?
The structure is 'a;b;c;d', the smallest is 'a', so treat the ';' as the
start of a trailer
On 07/13/2006 12:47 AM, Dr.Ruud wrote:
Mumia W. schreef:
Ryan Moszynski:
I need to write some code to allow users to specify which of a whole
bunch of elements(e.g.512/1024) that they want to view. My idea for
how to do this was to have them input a semicolon delimited list, for
example:
1
On 07/12/2006 05:08 PM, Ryan Moszynski wrote:
I need to write some code to allow users to specify which of a whole
bunch of elements(e.g.512/1024) that they want to view. My idea for
how to do this was to have them input a semicolon delimited list, for
example:
1-10;25;33;100-250
i tried
Chasecreek Systemhouse wrote:
On 7/10/06, Mumia W. [EMAIL PROTECTED] wrote:
I'm trying to learn to use Curses::UI, and I read the top of perldoc
Curses::UI and found some example code. Unfortunately, it doesn't work.
This is my program:
#!/usr/bin/perl
use strict;
use warnings;
use
Ryan Dillinger wrote:
[...]
#!/usr/bin/perl
use warnings;
use strict;
open LYNX, lynx -source http://www.perl.com/ | or die Can't open lynx:
$!;
$_ = ;
$_ = LYNX until /standard\.def/;
If 'standard.def' is not found, this line loops forever.
my $head = LYNX;
$head =~ m|^A
Gregory Machin wrote:
Hi
I'm writing a script to pass a config file and put the values in a hash,
with the key being the directive and the value bing the options,
but some directives don't have options, so in that case i want to store the
directive as the value so that for completeness..
i'm
Mumia W. wrote:
[...]
if (m/^([\w-]+)(?: +(.*))?$/) {
$directive{$1} = $2 || $1;
}
This is much more readable:
my ($key, $value) = split /\s+/, $_, 2;
$directive{$key} = $value || $key;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED
Randal L. Schwartz wrote:
Rob == Rob Dixon [EMAIL PROTECTED] writes:
Robmy @new = grep /[^.]/, readdir DIR;
This is still the wrong regex. While it's narrow enough for windows, it will
*break* on Unix. No reason not to do the right thing here:
grep { $_ ne . and $_ ne .. }
I'm trying to learn to use Curses::UI, and I read the top of perldoc
Curses::UI and found some example code. Unfortunately, it doesn't work.
This is my program:
#!/usr/bin/perl
use strict;
use warnings;
use Curses::UI;
my $cui = new Curses::UI (-color_support = 1);
my $my = $cui-dialog(
Mumia W. wrote:
I'm trying to learn to use Curses::UI, and I read the top of perldoc
Curses::UI and found some example code. [...]
No, I mean I. I found some example code.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org
Dr. Claus-Peter Becke wrote:
[...]
foreach (/(\w+)/i) {
push @words,$;
}
print$q-popup_menu('to_thesaurus', @words);
[...]
Use the /g (global) option to the match operator, and push $_ onto
@words rather than $:
foreach (/(\w+)/ig) {
push @words, $_;
}
Or ditch the 'foreach'
Dr. Claus-Peter Becke wrote:
dear mumia w.,
thank you for your support. i have chosen the simplest solution you
recommanded. i still have one problem. i would like to print every word
in a new line.
push @woerter,/[a-zäöüß]/ig;
print$q-li(@woerter);
it's unfortunaltely impossible
Monomachus wrote:
I don't know why my emails don't pass the Spam Firewall when I want to send a
letter to beginners@perl.org
--- Forwarded message --
From: Mail Delivery System [EMAIL PROTECTED]
[...]
Your messages are making it onto the list. This bounce happened because
a subscriber's
Ray Gebbie wrote:
I checked the Socket.so file and it is readable and executable by all (and
the directories are readable also). I have no understanding of what the
'Bad address' error means.
This is all happening before the script even starts to execute. If I
comment out the use Net::FTP;, I
Roman Daszczyszak wrote:
Hello all,
I am using a script to parse a CSV file with approximately 65,000
records. Some of these records contain characters such as é, ì, etc.
I can read and write lines containing these characters via a file
handle, however when I try and parse the line using the
Ray Gebbie wrote:
I have a pretty simple script that I am running on AIX 5.3 using
Perl 5.8.2. The script runs fine standalone, but when trying to run
it from a jsp running on a web site, I get the following:
ERROR: Can't load '/usr/opt/perl5/lib/5.8.2/aix-thread-
multi/auto/Socket/Socket.so'
Offer Kaye wrote:
Hi,
Can anyone tell me if it is possible to define 2 different formats for
the same filehandle?
The reason I am asking is that I want to print 2 different tables to
the same text file and I don't want to use printf statements. For me
at least, code that uses printf to print
Offer Kaye wrote:
On 7/5/06, Jeff Peng wrote:
Hello,
I think there are not relation between your implement and the filehandle.
As far as I can tell, a format must have the same name as the
filehandle to which you want to print it, and once you define a format
you cannot change it. So these 2
John Hennessy wrote:
[...]
I am using %03.4f to provide output that looks like 100.
I would like number less than 100. to look like 099.
I would like to keep the 3 digits prior to the decimal point either with
or without the leading zero as required.
Any suggestions welcomed.
Beginner wrote:
Hi,
I am being a bit lazy here. I already had this hash defined (cut pasted from another file) and
didn't want to re-type it.
my %char = (
65 = 'a',
66 = 'b',
67 = 'c',
68 = 'd',
[...]
But now I need to find the key given the value. EG: What
Andrej Kastrin wrote:
[...]
$symbol=$e-{symbol};
print $id|$title|$symbol\n;
}
Use the 'ref' command to find out if $symbol is an 'ARRAY' reference. If
it is, use 'join' to join all the elements into a string and put it back
into $symbol before you print.
--
To unsubscribe, e-mail:
Tom Phoenix wrote:
On 6/30/06, Mumia W. [EMAIL PROTECTED] wrote:
In the parent, I want to redirect STDOUT to 'logfile' then fork. In the
child, I want to print something. That something should end up in the
log file, but it's not working.
my $child = fork();
exit ($child ? parent() : child
Jean-Charles Ripault wrote:
Hi all,
For a customer project I'm writing a firewall proof script.
This script, between two systems tries systematically all tcp ports (up
to a given parameter) of all target network.
Now, I've made a double loop (one for the IP addresses, one for the
ports) to
Mumia W. unfortunately, wrote:
The in the 'system' command allows of asynchronous [...]
s/allows of/allows for/
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
RICHARD FERNANDEZ wrote:
[...]
It decrypts my file successfully. But if I break up the arguments
like it says in the doco, like so:
my @gpg_command = (/usr/bin/gpg, --decrypt, $encrypted, ,
$decrypted, 2 /dev/null);
AFAIK, you can't use 2 file to do output redirection when you use the
I can't seem to redirect STDOUT to a file before forking in my perl
program.
In the parent, I want to redirect STDOUT to 'logfile' then fork. In the
child, I want to print something. That something should end up in the
log file, but it's not working.
Here is my code:
use strict;
use warnings;
Mumia W. wrote:
I can't seem to redirect STDOUT to a file before forking in my perl
program. [...]
Forgive me for sending this three times. I was dealing with MUA
braindamage.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http
dzhuo wrote:
open files are attributes of a process. after you fork, you have 2
processes, files locks, open handles, as well as pending signals and
such are not shared. ie, when you print to STDOUT in child, it's not the
same STDOUT you expect in parent. why not use a pipe?
#!/usr/bin/perl
Ron Johnson wrote:
When US keyboards have the Euro symbol on it, then it will have
happened.
P.S. - How do you enter a Euro symbol from a US kbd into Tbird?
One key on your keyboard might be set aside for composing foreign
characters; this is called the Compose key. To enter a Euro (€)
Mumia W. wrote:
Ron Johnson wrote:
[...]
Oops, I sent to the wrong list. My apologies.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/ http://learn.perl.org/first-response
Dan wrote:
LWP or HTTP::Client?
i've used both and run across..some problems. [...]
i need the most reliable to fetch the feed, and pass me the body
of the page so i can pass it to an xml parser of sort.
unless there's something else which can already do that? [...]
Hi Dan.
I've played
301 - 377 of 377 matches
Mail list logo