It's late so maybe I'm missing something, but here's one way:
#throw away the header and keep everything after
"application/octet-stream"
my($junk,$data2) = split(/application\/octet-stream/,$data);
#split the rest up by commas and put it into an array
my @records = split(/,/,$data2);
Th
Here's a simpler example that contains some tools that might be useful to
you. (Sorry for the lazy hash declarations.) If you explain the bigger
picture, you might get suggestions for data structures that can be
manipulated more simply.
Katy
my %one = qw(_cat peach _dog apple _mouse apricot
Hendricks Paul D A1C 27 IS/INYS wrote:
> Hello beginners!
>
> Where do I start... I've already done some reading on this and I've played
> tag the wall with the forehead long enough.
> What I'm challenging myself to do is to create:
>a) a way to name a hash from user input
Don't.
If you re
Hi
I'm trying to parse an uploaded csv file. From the HTTP info I have a string
that looks like this
Content-Disposition: form-data; name="afile";
filename="C:\myfolder\mytest.csv" Content-Type: application/octet-stream
12345678,John Doe 79696676,Superman 215154552,Wilfred DeSilva 216215,Bart
Sim
"John W. Krahn" <[EMAIL PROTECTED]> writes:
>> >> $rein_str = shift;
>> >>
>> >> while(<>){
>> >> chomp;
>> >> $pre_out = $_;
>> >> ($out = $pre_out) =~ s/$strp_re/$rein_str/;
>> >
>> >($out = $pre_out) =~ s/$strp_re/qq["$rein_str"]/ee;
>>
>> I find no reference to `qq'
zentara wrote:
> You must install Tk, it's a separate module. Plus
> the program needs a MainLoop statement.
It depends on the Perl version. When I tried to install Tk on Perl 5.6.1, I got an
error message saying it was already installed. I tried the code posted in:
Subject:
Re: How do
Harry Putnam wrote:
>
> John,
> Somehow I over looked your answer to my question and have since
> posted a couple more similar questions. Your answer here pretty much
> provides a way to make my scripts work Thanks.
>
> If possible, please note my comments in the code below and point me to
>
Ktb wrote:
>
> I have a file "test2" with the format of:
>
> [Kent]
> Address:3473278 jones
> omaha, ne 65465
> Phone: Home 8943, Work 83485, Cell 84853
> Email: Home @j.cor, Work
> Birthdate: 88484
>
> [Pat]
> Address:747474 street
> where, CA 8484
John,
Somehow I over looked your answer to my question and have since
posted a couple more similar questions. Your answer here pretty much
provides a way to make my scripts work Thanks.
If possible, please note my comments in the code below and point me to
something that will allow me to unde
Lance Murray wrote:
>
> Hello:
Hello,
> I know I can return multiple scalar values from a subroutine using an array,
> but how do I return multiple arrays, hashes, etc from a subroutine?
You have to return references to arrays and hashes. This is all
explained in the perlsub document.
perldoc
Harry Putnam wrote:
>
> I posted here a while back about how to set the parameters of an
> s/// type of action, inside a script from the cmdline.
>
> Paul posted a simple script in answer that does exactly that.
> and even allows any modifier to be set from cmdline.
> (Slightly modified for cla
[EMAIL PROTECTED] wrote:
>
> OK, I am not having any luck figuring out the regex stuff.. Can somebody
> share with me a perl version of grep that works or tell me the "Perl
> Expression" for this.
http://www.perl.com/language/ppt/src/grep/index.html
http://www.perl.com/language/ppt/src/egrep/inde
>> I have another problem, I have a string of nicknames that looks like:
>>
>> $mystring1 = "nick1,nick2,nick3,nick4,nick5";
>>
>> I've asked this question before, but because of my bad regex
>> knowledge, I'm asking again, but this time in a slightly different
>> context. The last time I asked,
>I've played
>tag the wall with the forehead long enough.
> a) a way to name a hash from user input
If you mean assign a value with in a hash using the user input, then:
my %hash
$key = ;
$val = ;
$hash{$key} = $val;
If you really want to let the user name your var
I have a file "test2" with the format of:
[Kent]
Address:3473278 jones
omaha, ne 65465
Phone: Home 8943, Work 83485, Cell 84853
Email: Home @j.cor, Work
Birthdate: 88484
[Pat]
Address:747474 street
where, CA 848484
Phone: Home 555-, Work 33
dan wrote:
> Hey again.
>
> I have another problem, I have a string of nicknames that looks like:
>
> $mystring1 = "nick1,nick2,nick3,nick4,nick5";
>
> I've asked this question before, but because of my bad regex
> knowledge, I'm asking again, but this time in a slightly different
> context. The
Hey again.
I have another problem, I have a string of nicknames that looks like:
$mystring1 = "nick1,nick2,nick3,nick4,nick5";
I've asked this question before, but because of my bad regex knowledge, I'm
asking again, but this time in a slightly different context. The last time I
asked, the strin
Have a look at:
% perldoc perlsub
Esentially you can't return multiple array's (you probably can with
fancy prototyping - but i'm not sure of that) - you usually have to use
references instead.
On Wed, 2003-02-26 at 09:05, Lance Murray wrote:
> Hello:
>
> I know I can return multiple scala
>but how can I tell when all three are finished? If I use
> $obj1->Wait(INFINITE);
> $obj2->Wait(INFINITE);
> $obj3->Wait(INFINITE);
>
>what happens if $obj2 finishes before $obj1?
looks like this works fine...
PHF
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional c
"Daryl" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Well your in the wrong place for language neutral advise: however,
Elements
> of Programming with Perl by Manning Press - gives a good grounding in the
> thought process needed utilizing Perl as the language.
>
I am going through
www.perldoc.com search for File::Find. It does the recursion for you!
"Prasad Karpur" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I am new to Perl and would like to know how to look into every
subdirectory. Any help would be greatly appreciated.
>
> #!/usr/bin/perl
>
> #use str
OK, I am not having any luck figuring out the regex stuff.. Can somebody
share with me a perl version of grep that works or tell me the "Perl
Expression" for this..The reason I need something like perl is because the
2048 character limitation on grep... We have situations where the line can
be much
if you are just trying to access a set of nested arrays, use something like
my @parent=([1,2,3],
[7,8,9]);
print "$parent[0][1]\n";# outputs 2
print "$parent[1][2]\n";# outputs 9
## now to access the the info, use references
foreach my $num(@parent){
foreach my
something like:
foreach my $key( keys %hashA ){
if( $hashB{$key}){ print"do the dance of joy, duplicate key found" }
}
should do the trick.
"Aimal Pashtoonmal" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hello people,
>
> Can any one please help me. I have 2 hashes, hashA a
> how do I return multiple arrays, hashes, etc from a subroutine?
You can't... but you can return references.
my ($x, $y) = foo(); # returns 2 references
my @x = @{$x}; # "dereference" back to an array
my @y = %{$y}; # "dereference" back to a hash
sub foo {
my @x = (1,2,3);
my %y = (k1 => 1,
Hello:
I know I can return multiple scalar values from a subroutine using an array,
but how do I return multiple arrays, hashes, etc from a subroutine? For
example, the following snippet...
my @ip_addresses = &getIPAddresses;
my (@hostfile, @no_dname) = &getHostNames(@ip_addresses);
I posted here a while back about how to set the parameters of an
s/// type of action, inside a script from the cmdline.
Paul posted a simple script in answer that does exactly that.
and even allows any modifier to be set from cmdline.
(Slightly modified for clarity)
cat example1.pl
#!/usr/bin
Thanks.
The telling story is
((print(1) and 1) and ('???', '???'));
Perl seems to be looking for another operator when using 'and'.
-Jeff
--- Paul Johnson <[EMAIL PROTECTED]> wrote:
> On Tue, Feb 25, 2003 at 12:21:49PM -0800, Jeff Westman wrote:
>
> > Basic question on using '&&' vs 'a
On Tue, Feb 25, 2003 at 12:21:49PM -0800, Jeff Westman wrote:
> Basic question on using '&&' vs 'and'. I see that '&&' has higher precedence
> than 'and', but why does
>
> print 1 && 1 && 0;
> print "\n";
> print 1 and 1 and 0;
> print "\n";
>
> return
> 0
> 1
>
> I would have exp
Hi All,
I'm hoping someone has done this before. I need to spawn 3 processes and
then wait for all three to finish.
spawn like this:
my $obj;
my $appname = $perl;
my $cmdline = "$deliverscript $arg";
my $iflags = 1;
my $cflags = CREATE_NEW_CONSOLE | NORMAL_PRIORITY_
> Basic question on using '&&' vs 'and'. I see that '&&' has higher
precedence
> than 'and', but why does
>
> print 1 && 1 && 0;
> print "\n";
> print 1 and 1 and 0;
> print "\n";
>
> return
> 0
> 1
>
> I would have expected both statements to return 0.
>From a couple of experiments, I wou
Basic question on using '&&' vs 'and'. I see that '&&' has higher precedence
than 'and', but why does
print 1 && 1 && 0;
print "\n";
print 1 and 1 and 0;
print "\n";
return
0
1
I would have expected both statements to return 0.
Thanks
Jeff
_
There are probably oodles of ways of doing this.
Here are two:
# An array slice
@[EMAIL PROTECTED];
or
# start at position 0, remove 9 elements
splice @data, 0, 9;
Pete
On Tue, 2003-02-25 at 14:39, dan wrote:
> onwards. My way of doing this was:
> shift(@data); x 9
--
To unsubscribe, e-mail
> "Beau" == Beau E Cox <[EMAIL PROTECTED]> writes:
Beau> Hi -
Beau> Just use a recursive subroutine to traverse your directory tree
Beau> from any starting point:
No no. You ignore the problem of symlinks. Please use File::Find,
unless you really understand File::Find's every behavior.
--
Mo Elwaisi wrote:
> thanks for all the help. one question though, you see when i am asked for
> where the apache src is located? i typed /tmp/httpd-2.0.40/src. but i got
> a message saying cannot stat '/tmp/httpd-2.0.40/src'. what shall i do
>
i am sure you downloaded the wrong thing. you need t
Hi,
I've come across a dilemma, I can solve it the long way round, I'm enquiring
if there's a shorter way to do this.
I have an array, @data, which contains a lot of data which has been received
from a socket. The problem is I want to have the 10th item (9th index)
onwards. My way of doing this w
thanks for all the help. one question though, you see when i am asked for
where the apache src is located? i typed /tmp/httpd-2.0.40/src. but i got a
message saying cannot stat '/tmp/httpd-2.0.40/src'. what shall i do
From: david <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PR
Mo Elwaisi wrote:
> do i do this although i have apache installed on my server. it came with
> Red Hat Linux 8. (i have Apache 2.0.40)?
>
even Apache is shipped with your Linux box, chances are that the source is
not included. you will need to source to rebuild Apache to have mod_perl
support.
Hi -
> -Original Message-
> From: Prasad Karpur [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, February 25, 2003 3:18 AM
> To: [EMAIL PROTECTED]
> Subject: How to look into every subdirectory
>
>
> I am new to Perl and would like to know how to look into every
> subdirectory. Any help would
From: "Crowder, Rod" <[EMAIL PROTECTED]>
> As I said, please don't shout at me
We wount shout. We pity you.
> A situation has arisen at work, where a new application which has been
> bought requires VB script to do pattern matching and string
> modification.
>
> Yes I know that it is easier in
go to the microsoft site and look for VB script.
http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid
=28001169
"Rod Crowder" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> As I said, please don't shout at me
>
> A situation has arisen at work, where a new
I am new to Perl and would like to know how to look into every subdirectory. Any help
would be greatly appreciated.
#!/usr/bin/perl
#use strict;
use Cwd;
my $curr = cwd();
opendir(CURRDIR, $curr) or die "can't open directory ($!), exiting.\n";
my @files = readdir(CURRDIR);
#closedir(CURRDIR);
Hi, Lance && list!
> > Hi,
> >does anybody have sample perl script multi
> > threaded program
As of perl 5.8.0 there is a new thread implementation (IThreads).
Although its not yet recomended for production, its worth a look.
perldoc perlthrtut gives a good starting point.
HTH,
Jan
--
> "John" == John W Krahn <[EMAIL PROTECTED]> writes:
John> Prasad Karpur wrote:
>>
>> I am new to perl. I would like to look into every directory below my home
>> directory and look for files in it.
>>
>> [snip]
>>
>> Any Help would be greatly appreciated.
John> Use the File::Find module.
Hendricks Paul D A1C 27 IS/INYS wrote:
> Hello beginners!
>
> Where do I start... I've already done some reading on this and I've
> played tag the wall with the forehead long enough.
Are you working through a book, like Learning Perl? If not, you should,
because it takes you step by step through
On Tue, 25 Feb 2003 10:30:32 +0530, [EMAIL PROTECTED] (Anand
Ramakrishna) wrote:
> I work on Solaris and I have perl installed. Do I have to install Perl Tk
> separately.
>I got this sample program from the web and I tried to run it in my machine. I get
>this error when I do it.
>"Can't locate
Hello people,
Can any one please help me. I have 2 hashes, hashA and hashB, the keys
in both cases, are made up of a mixture of numbers and words etc. But
the keys are differnt so I presume I cannot use if exits or if defined.
Is there anyway of check to see if the words and numbers making up the
Hello beginners!
Where do I start... I've already done some reading on this and I've played
tag the wall with the forehead long enough.
What I'm challenging myself to do is to create:
a) a way to name a hash from user input
b) find a way to create a multi-level hash (hash within a hash)
Olivier Wirz wrote:
> Hello,
>
> Ich have an anonymous array of anonymous hashes:
>
> $self -> {_definitions} = [ { IN => "file1.txt",
> INOUT=> "file1.dat",},
>{ IN => "file2.txt",
>
Rob:
You may try PERDIVER.
Its very simple and quite useful.
You can download from here
http://www.scriptsolutions.com/programs/free/perldiver/
Just upload chmod 755 and run.
-rm-
- Original Message -
From: Rob Richardson <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, F
Cc wrote:
>
> Hi,
Hello,
> I'm a beginner at PERL. I've used it on and off, but only
> just recently got myself back into the picture. I figured
> that if you forget something in PERL, it'd be easy to take
> it up again. So far, I'm not too sure of the ease
> of taking up PERL again. Before,
On Mon, 24 Feb 2003 10:45:44 -0800 (PST), [EMAIL PROTECTED] (Madhu
Reddy) wrote:
>Hi,
> does anybody have sample perl script multi
>threaded program
Here are a couple of simple examples.
When you run them, open an xterm an watch "top"
while they run.
##
On Fri, 21 Feb 2003 14:14:08 +0200, [EMAIL PROTECTED] (Yargo) wrote:
>Hi all,
>I have this little script that asks the user for UserName & password.
>
>I can't figure out where do I get the input.
>e.g. :
>UserName = yargo
>Password = q1w2e3
Here's an example:
#!/usr/bin/perl
use Tk;
my $MainWi
Many thanks, this looks useful.
I appreciate the help as this is slightly OT
Regards
Rod Crowder
The information contained in this e-mail is intended only for the individual
or entity
to whom it is addressed. Its contents (including any attachments) are
confidential
and may contain privileged
On Tue, 25 Feb 2003, cc wrote:
> Hi,
>
> I'm a beginner at PERL. I've used it on and off, but only
> just recently got myself back into the picture. I figured
> that if you forget something in PERL, it'd be easy to take
> it up again. So far, I'm not too sure of the ease
> of taking up PERL ag
Look if the archive below contains some interesting info for what you want.
HTH,
José
== THE ARCHIVE
From: Ben Crane <[EMAIL PROTECTED]>
> Is there a way of using perl's amazing
> pattern-matching skills within VB???I find using VB to
> query txt files, etc to be more cumbersome and less
> frie
As I said, please don't shout at me
A situation has arisen at work, where a new application which has been
bought requires VB script to do pattern matching and string modification.
Yes I know that it is easier in Perl, (and the app supports perl) but the
PHB has decreed that the VBscript route
do i do this although i have apache installed on my server. it came with Red
Hat Linux 8. (i have Apache 2.0.40)?
Cheers
From: david <[EMAIL PROTECTED]>
Reply-To: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Re: Installing the Apache::Registry to get PERL working
Date: Mon, 24 Feb 2003
Well your in the wrong place for language neutral advise: however, Elements
of Programming with Perl by Manning Press - gives a good grounding in the
thought process needed utilizing Perl as the language.
--On 24 February 2003 12:46 -0700 Jose Malacara <[EMAIL PROTECTED]> wrote:
Does anyone r
Prasad Karpur wrote:
>
> I am new to perl. I would like to look into every directory below my home
> directory and look for files in it.
>
> [snip]
>
> Any Help would be greatly appreciated.
Use the File::Find module.
perldoc File::Find
John
--
use Perl;
program
fulfillment
--
To unsubscr
Hi,
I'm a beginner at PERL. I've used it on and off, but only
just recently got myself back into the picture. I figured
that if you forget something in PERL, it'd be easy to take
it up again. So far, I'm not too sure of the ease
of taking up PERL again. Before, I made a few perl scripts.
Now,
Hello all,
I work on Solaris and I have perl installed. Do I have to install Perl
Tk separately.
I got this sample program from the web and I tried to run it in my machine. I get this
error when I do it.
"Can't locate object method "new" via package "MainWindow" at ./gui_test.pl
Le Sat, Feb 22, 2003 at 11:37:57AM -0800, R. Joseph Newton a écrit ...
> > > I post statistics to a newsgroup called news:alt.activism.death-penalty
> > > once per week, using the 'ngstatistics' script by H. Alex LaHurreau and
> > > Davide G. M. Salvetti. You can see the script in its entirety h
Le Fri, Feb 21, 2003 at 05:19:06PM -0800, Michael Kelly a écrit ...
> > OK ... no wants to answer me.
> >
> > *shrug*
> It's often not a matter of people not wanting to answer you so much as
> not being able to. I personally have no experience in the area of your
> question. Answers on mailin
I am new to perl. I would like to look into every directory below my home
directory and look for files in it.
#!/usr/bin/perl
#use strict;
use Cwd;
my $curr = cwd();
opendir(CURRDIR, $curr) or die "can't open directory ($!), exiting.\n";
my @files = readdir(CURRDIR);
#closedir(CURRDIR);
foreach
GlacierPlease post in plain text. Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hello everyone,
I've got a question. I hope anyone can take the time to look at my problem.
I've started writing perl for use with CGI about a year ago. I'm average advanced
with perl.
After writing and writing a lot I stumbled upon a problem. This is it: I've got a text
database
in the form of
Here is the perl script being used..
It supposedly takes regex or perl expressions for parameters.. however I
have to search for the following string :
TDS-RES.1.2345678
but when I use the following regex it fails:
peg "TDS-RES/.1/.2345678" MEDLAB*
peg: error in Perl expression: (TDS-RES\.1\.2
> Greetings!
Hello
>
> I'm trying to do some Perl for a non-profit organization. The computer
> administrator doesn't know very much about Perl or about the server.
> If I were to ask him what Perl modules were available, he'd probably
> just have to call somebody else and get back to me. Is the
you might want to start with
http://www.perldoc.com/perl5.8.0/pod/perlfunc.html#Alphabetical-Listing-of-P
erl-Functions
and look for 'fork'
warning: there is no fork for win32, you have to use theWin32::Process
module.
"Madhu Reddy" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
>
Hi Robert
I am also doing & looking exactly the same & some more info .
I have got many info , mails from this helping list , examples on net
which i myself hasn't worked on - what all i know about my own databsae of
this search results is
Win32::
there are some modules for win32
like AdminMisc
71 matches
Mail list logo