I know it's a lot more than just an editor but try Komodo by ActiveState.
http://www.activestate.com
best,
Mark
Tom Turpin" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Could someone suggest a good editor for writing scripts
Hello,
There is always a better way to do things. That is what makes life
interesting.
I think any contributions from anybody should be appreciated.
Regards Mark
- Original Message -
From: "Telemachus"
To:
Sent: Tuesday, August 18, 2009 12:40 PM
Subject: A side no
2level
...
and so on.
Typing
perl -c Test.pl
yields
Test.pl syntax OK
So how come no "Hello world!"?
I really want Perl to have me at Hello World. What should I do?
- Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
erl -e 'print "Hello World"'
Ah, yes, I forgot to mention in my first post that I did try perl
-e 'print "Hello World"' and it worked just fine.
Cheers,
Parag
- Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
running in VirtualBox, and I get the same
result in a root terminal there, too. -- That is, when I change
directory to the exact same script file and type "perl test.pl".
- Mark
int for grep { $_< 31 or $_> 126 } map ord, split //' t.pl
It will tell use what control characters may be lurking in that file of yours.
Here is the output from the above command:
13
13
13
13
What does that mean?
- Mark
--
To unsubscribe, e-mail: beginners-unsubscr...@perl
; pasted the code from BBEdit into Emacs, suddenly the
script ran perfectly in iTerm. Problem apparently solved. Thanks, everyone!
- Mark
ails on my
computer, reading the text into the string $line, and then concluding by
printing $line in the Terminal. Also, I apologize for all the inelegance
of this code -- repeated sections instead of functions, probably sloppy
regex, and so on. This is rookie stuff.)
- Mark
#!/usr/bin/env perl
u
one: Email-Sender. But I can't
install it on my Macbook Pro in order to test it locally. I've tried to
install several different ways, the latest being a manual compile &
install of 'Bundle-Email'. When I tried 'make test', I got the output
below. What a
have a Debian-Lenny installation on VirtualBox, and was able to use
the CPAN client in there to install the Email modules. However, as you
can see, I didn't get far after that. I've also browsed the web a bit,
looking at parsing modules, as you suggested (to replace the clumsy
regex), but I
the automatic forwarding in the first place. I
set it up in the IT office, and since that day have not seen the
forwarding menu option in the webmail interface in any other location
either on or off campus. (Haven't been back to the IT office, as they
had minimal ability to be helpful on this issue).
- Mark
ink to the more complete manual goes nowhere),
this is what I wrote:
my $recipient = 'Mark Vecchio ';
Email::Sender::Simple->send($line, { to => $recipient });
It doesn't work, I hope for reasons that are obvious to some of you out
there. The script does run without thro
> On Dec 1, 7:31 am, jwkr...@shaw.ca ("John W. Krahn") wrote:
>
> Correction:
>
> my @sorted_files_in_directory =
> map $_->[ 1 ],
> sort { $a->[ 0 ] <=> $b->[ 0 ] }
> map { ( stat "$directory_name/$_" )[ 9 ], $_ }
map { [ ( stat "$directory_name/$_" )[ 9 ], $_ ] }
>
On Dec 27, 2:34 pm, paragka...@gmail.com (Parag Kalra) wrote:
> I was under the impression that regex modifier '/x' ignores the white
> space.
It ignores white space in the regular expression, not in the text you
are matching.
For example, the following are equivalent:
if($str =~/$str3/x){
I need to detect if input has been to my script or not.
For example, I would like to differentiate between an invocation from
the two lists below:
Examples where input is "provided":
perl myscript.pl input.txt
perl myscript.pl < input.txt
executable_that_writes_to_sdtout | perl myscript.pl
Examp
On Mar 14, 2:06 pm, jimsgib...@gmail.com (Jim Gibson) wrote:
> The standard Unix function for determining this is isatty(in fd), where fd
> is the file descriptor for the input/output stream. I don't know the
> equivalent in Windows. However, there is the file test operator -t that
> returns true i
nges, pears, coconut, lemons, grapefruit
4, 3, 2, 7, 1, 4, 0
3, 1, 4, 4, 0, 0, 1
0, 4, 0, 0, 4, 5, 0
Your help would be GREATLY apreciated!
Thanks
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Exactly what I'm looking for! (Amazing stuff)
Out of intrest, if I wanted to look at the exact no. sold
ie. get output like: apples, 4, 3 and 0
where would I start looking?
Many many thanks!
Mark
On Friday 12 April 2002 15:55, you wrote:
> On Friday, April 12, 2002,
Greetings,
I have been trying to understand the "tr///cds" pattern matching expression
using the Camel in a Nutshell book and another one that assures me that I
can do it in 24 hours. I am looking at an expession and bouncing about all
over Perldoc.com, yet I am thwarted. I am seeing strange li
> If you have Perl installed then you should also have the documentation
> for Perl installed. The perlre.pod and perlop.pod documents explain how
> tr///, y///, s///, and m// work.
>
> perldoc perlop
> perldoc perlre
I have ActiveState Perl on win2k and the docs are provided in html format.
I a
> I don't use Windows but if you open a DOS/console window and type those
> commands at the prompt they should display the relevant documents.
>
> C:\>perldoc perlop
> C:\>perldoc perlre
I used the command prompt, which is the only thing resembling a DOS prompt
on win2k and got this:
" 'perldoc'
HI,
Using /c in conjuction to tr/// as stated in 'perlop' complements the
searchlist. Is this to mean that the scalar in $val=~tr/this//c is also
scanned for any values of t,h,i or s that may be interpreted as negative
values of those character representations?
thanks,
mar
t;complements" the SearchPattern. OK
So my question is (drumroll) : Do I take it to mean that /c also adds the
negative values of the given SearchPattern to the SearchPattern? Otherwise,
what is the "complement of /a-z/ if not /-(a-z)/ ?
Thanks,
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
I can't seem to get ActivePerl working on my win2k machine.
I checked my enviroment variables and found it not there. I edited my ev's
to include Perl:
C:\Perl\bin and tried C:\Perl\bin\perl.exe;
I tried it both as User and as Admin.
I tried perl -v to test it out in both cases and got:
ome advice,
but it really doesn't seem VeryActive.
Thanks,
Mark
- Original Message -
From: "Leila Lappin" <[EMAIL PROTECTED]>
To: "mark" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, May 26, 2002 4:01 PM
Subject: Re: ActivePerl problem
EMAIL PROTECTED]
That is where I changed it.
I get : PATH=C:\WINNT\system32;C:\WINNT;C:\W...
but no Perl\bin\;
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
My problem was the
definition of "complement" as Perl understood it.
Thanks for your help.
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
n't add it to the "Path" myself. I just
entered in an individual path called perl thinking that that would do it.
Wrong.
Thanks,
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
x27;t believe that it is as easy as,
open(INFO, "datafile") || die("can't open datafile: $!"); In other
words how does it know what software to open the "datafile" with?
If I could get a look at sample code of this, that would be a HUUGE help.
Thanks in adva
the pipe operator more and see what happens.
Thanks
<[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]
> "Mark" <[EMAIL PROTECTED]> writes:
>
>> I have looked at the perlopen tuturial, but I am still not sure how to
>> accomplish this. I just can&
eed a seperate path
statement of it's own?
I know I asked this question several months ago when I was first getting it
installed and I'm sorry to ask again, but I forgot.
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
e component with it's
corresponding value? (ouch!)
%zone = {370,one,422,one,423,one,424,one, etc999,whatever}
What are pros and cons of my different options... if there is any?
Thanks,
Mark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
o the archives of this list have an online search feature. Once
again I can't seem to find any. :-)
TIA,
Mark
> Hi,
>
> I am trying to make hash of delivery zones that allows me to maintain a
> record of a zone for every postal code based on the first three digits of
> each zip. B
s I guess I'm just not sure if my logic is correct.
A really good hash tutorial would be of excellent help if anyone can guide
me to an online one. Bare in mind that I am a novice. :-)
Thanks,
Mark
> It really depends how YOU need to use %zone. Do you need to find out what
> n
ould it not?
wiggins: Thanks for the perlcircus link.
TIA,
Mark
> I don't think you need to do a lot of typing. your best approach(i think
of
> course) is to use the zip code as key and the zone code id as value. if
you
> use the other way around, you are bound to find your searc
How would one modify this to add an attachment to the email. Say, a gif or
jpg?
> John Storms wrote:
>
> # to, from, subject, body, [mailhost]
> sub mailit {
> my(%mail) = @_;
> if($mail{'to'} eq "") { return(0); }
>
> # Set default mail host
> if($mail{'host'} eq
You could just set up a web server on your own machine, if that's all you're
looking to do.
-Original Message-
From: bc [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 7:34 PM
To: [EMAIL PROTECTED]
Subject: space
who knows of some free web space that allows the use of perl? s
lto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 7:42 PM
To: [EMAIL PROTECTED]
Subject: Re: space
i'm a linux (mandrake) newbe and would love to, can you help me accomplish
that?
- Original Message -
From: "Mark S" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Se
something that a little simplier to use.
--Mark.
Nuts! I searched for "dial", "telephone", "telephony", "comm" ... the
obvious seems to be what I miss most often.
-Original Message-
From: Brent Michalski [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 08, 2001 6:36 AM
To: Mark Ross
Cc: [EMAIL P
lear as Mud?? Any ideas?
open (FILEHANDLE,$file);
while (){
chomp;
($type,$doc,$narrative,$amount,$bdate,$branch) = split(/,/);
if ($doc == " "){
doc =~ s/ /11/;
___
This
#!/usr/bin/perl
open THEOUTPUT, ">e:/test/output.txt";
while ( <$ARGV[0]> ) { print THEOUTPUT};
worked with this NT command file (NTWS 4 SP5)
perl.exe e:\test\droptest.pl $1
Not sure why perl.exe wouldn't run it without an absolute path, but
such are the ways of DOSney
Geez. I guess I opened up a can of worms.
Consider this a formal request that the list messages should default to
reply to the list, and either copy the originator (or no one). This
would best accomodate the way people communicate on lists, in my view.
I didn't originate this thread, but I feel compelled to comment in that
I typically us
Are you specifying the full file path? Are you using UNIX-style forward
slashes for directory delimiters?
Perl on NT will follow Windows conventions about finding and executing
files, and I never rely on the search path. Its always better to give a
full path to the executable.
Ex.
#!/usr/bin
Hi all,
I was wondering if anyone has a recommendation for a module that can encrypt
data via PGP. I've looked on CPAN, and there's a couple that seem to do what
I want. I was just wondering if the gurus out there could offer their input
on the good ones (how 'bout Crypt::PGP5 ?)
Thanks,
--Mark.
Having further considered, I agree with not munging. I've not run lists
but I've run mail servers, so lets not make anything messier that we
don't need to. Next we'll be mucking with DNS resolvers for our local
convenience, as it appears Win2000 has done. Yikes!
I would recommend anyone who wants
I started out doing the same thing on my NT box many moons ago, and
found this more reliable and easier to manage:
($day,$month,$date,$time,$year)=split (/ /,localtime);
--- Craig S Monroe <[EMAIL PROTECTED]> wrote:
> I decided that I wanted to time stamp each of
> the entries
>
> > $time =~ s
Is Perl in your system path? The first line in the script doesn't help
any in DOSneyland. I usually just type "perl script.pl" if it is. It is
possible to associated the dot-p-l extension with Perl.exe in the
Windows GUI, but I don't believe its possible to flag an executable in
dos that isn't EXE
--- [EMAIL PROTECTED] wrote:
> Hello! I am new to Perl programming so please, bare with me.
I am typing this naked to the waist if that helps.
I have
> been
> working on Perl for a month now and I'm just getting started on
> regular
> expression. Anyway, learning Perl is not my problem. My pr
Just so I understand, you can't:
($date, $time, $add1, $add2, $add3, @rest) = split(/\|/); # can you?
> @f = split(/\|/); # \| because | is a regexp char, splits $_
>
> # grab the bits we want to duplicate for each record. you will have
> # to tweak for the actual number of fields. @r
At 02:58 PM 6/15/01 -0400, Tim Musson wrote:
>Hey all,
>
>I have been using
>#!/perl -w
>
What about using "use warnings" rather than the "-w"?
It seems that I read in Programming Perl to use "use warnings" but it all
seems foggy now.
Are the two the same thing?
>and based on some posts hav
--- [EMAIL PROTECTED] wrote:
> Ok here goes;
>
> the name of the file that I'm trying to run is hello.pl which is
> located in
> at:
>
> C:\Perl\hello.pl
>
> When I open (launch) my PERL inturpreter (location
> C:\Perl\bin\perl.exe) I
> get a black screen with a blinking white line.
Whoa!
);
print LOG "Unpacked format for array: \n";
for $i (0..64) { print LOG $testbad[$i]; }
print LOG "\n";
for $i (0..64) {
if ($testbad[$i] == 13) { $testbad[$i] = 40; }
}
__SNIP__
Many Thanks,
Mark Bedish
Surrey,UK
in for this type of
processing, but VB is the standard so I have an uphill struggle :-(
Thanks again,
Regards
Mark Bedish
Surrey,UK
Hi Guys
I know this looks like a cgi problem but I believe it is more of a varable
scoping problem I just happen to be having with the CGI module. While I am
waiting for answers to this I am off to buy the most reccomended ""Learning
Perl" book. Thanks for any help
I have this code.
require
Your gonna have to remove yourself. Didn't you get a confirmation email with the
details of the what, where, why and how?
Mark Bergeron
Perl Junkie
-Original Message-
From: "Debo Lawrence-Cornett"<[EMAIL PROTECTED]>
To: [EMAIL PROTECTED], [EMAIL PROTECTED]
Date: We
@fields = qw/Text Time/;
my %ch;
foreach my $key (sort { $ch{1} cmp $ch{2} } keys %ch ) {
print OUT "$key: $ch{$key} \n"; # show key and value
}
Thanks,
Mark Bedish
s and there might be more than one
occurrence. I could get round it by loading into mySQL DB and querying
it but that seems a bit of a long way round!
Regards
Mark
Dave,
Thanks very much, it worked a treat except where there was a blank instead of a
numeric, so I must tidy up my data first!
I still might put it into mySQL though, there is so much more you can do when
it is in a database.
Regards,
Mark
-Original Message-
From
Hi
I am sure this is not supposed to be so hard but I still cannot get the hang
of passing these objects around.
What I am trying to do is work with CGI.pm
I have a cgi object and I also want to break my program up into subs to keep
it clean and easy to code.
So I create a CGI object. It's gre
1 records were deleted from Table: bankdiffs .\n";
}
It just wont go inside the while and gives the following error :
DBD::Oracle::st fetchrow failed: ERROR no statement executing (perhaps you
need to call execute first) at clear.pl line
Learning Perl
Learning Perl on Win32
Programming Perl
Advanced Perl Programming
Perl Cookbook
You can surf all of these books online here:
http://corvin.spb.ru/
Or download all via FTP from here:
ftp://hrg.dhtp.kiae.ru/pub/corvin/
Mark
__
Do You
lf that was freely distributed before
the CD bookshelf went on sale.
Question - Is it unethical to give away a beta version
of a software (or CD books) after the commercial
version is marketed? Surely O'Reilly would have known
by providing a free beta version, that it would make
it's wa
35, 9.0, 1
(The parameters from the field 'ssA:')
Sorry about the format of the input file, the formatting from the text
editor didn't translate. Any help would be enormously appreciated.
Thanks,
Mark Flynn
Resea
Hi,
At the moment, I'm doing: my $temp_obj = bless {}; in a childs SUPER class
to create an object of SUPER's type that I can then use to call methods
like: $temp_obj->method_two(); This ensures that when method_two does a
$self = shift; and uses $self to call methods that exists in both the chil
Hi Jon,
Your script should look something like this:
#!/usr/bin/perl
use CGI qw( :standard );
open(LOGFILE, "logfile.txt") or die "Can't open logfile: $!\n";
while($line = ()) #
{
chomp $line;
push(@links, $line);
#This was the main problem. You were doing
# $line = $link which m
shows that both of these run at about the same
speed - but my concern is symantics and readability/usability rather than
performance.
~mark
#!/usr/bin/perl
package grandparent;
use vars qw { @ISA };
@ISA = qw();
#Switch this to 1 to use the
$self =
shift @_; Is there a better way to do this?
-Original Message-
From: Jeff 'japhy/Marillion' Pinyan [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 10:15 PM
To: Mark Maunder
Cc: Beginners@Perl. Org
Subject: Re: Is __PACKAGE__->method() the best way...
On J
ssage-
From: Michael Fowler [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 19, 2001 11:25 PM
To: Mark Maunder
Cc: Beginners@Perl. Org
Subject: Re: Is __PACKAGE__->method() the best way...
On Thu, Jul 19, 2001 at 10:20:48PM +0100, Mark Maunder wrote:
> Also, calling SUPER:: on the orig
Sorry, just read the rest of your message.
Sortof. Grandfather has some utility methods in it that Son and Father both
use. Son calls a method (call it save() )which it has defined. Within this
method it uses one of the utility methods (lets call it
Grandfather::get_name() ) defined within grandf
heirarchy.
-Original Message-
From: Michael Fowler [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 20, 2001 12:15 AM
To: Mark Maunder
Cc: Beginners@Perl. Org
Subject: Re: Is __PACKAGE__->method() the best way...
On Thu, Jul 19, 2001 at 11:31:20PM +0100, Mark Maunder wrote:
> But I still
It's not a stupid question.
The script is fine, and it would run in a *nix shell, but you're using
it on the web, so you have to add this line just below the shebang:
print "Content-type:text/html\n\n";
-Original Message-
From: Tom Malone [mailto:[EMAIL PROTECTED]]
Sent: Thursday, July 1
got a 403 forbidden
tom
-Original Message-
From: Scott Carmichael [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 20, 2001 12:07 AM
To: 'Mark Saunders'; [EMAIL PROTECTED]
Subject: RE: stupid question
I was originally going to reply with the same thing, but I also got an
int
The URL is what you're requesting. Unless you receive a redirect with
LWP::UserAgent, you must know what you're requesting. Either its the first
page you hit on the site, or you've grabbed the URL from an HREF in a
requested document. To avoid transparent redirects, subclass LWP::UserAgent
and ove
Good Morning/Afternoon to all
I need some error checking (or rather field validation) within my script
itself to ensure a date field coming across on a form is in the format of
dd-mm-. I would rather not have to strip the field down to check the
individual numbers and then put them back toget
On Saturday 04 August 2001 18:35, . wrote:
> Another thing that I notice the llama book fails to mention is random
> number generation. Is this possible in Perl? (More specifically in a CGI
> script.)
could also look at Math::TrulyRandom or Math::Random
--
To unsubscribe, e-mail: [EMAIL PROTE
Thank God for UNIX and Linux...!
Mark Normand
IT Support Specialist
16 West Kenneth St.
Lawrence, MA 01843
Tel: 978-975-0588
Mobile: 978-590-3143
Email: [EMAIL PROTECTED]
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> I was wondering if there was anyway to print colored
> text at the command
> line.
I actually was looking for this today as well. Check
out:
http://www.perldoc.com/perl5.6/pod/perlfaq8.html#How%20do%20I%20print%20something%20out%20in%20color%3f
> Thanks,
> Tyler Longren
> Captain Jack Communi
gt; >
> > > Jonathan Acierto
> > > Perl Programmer
> > > Ocentrix Inc.
> > > 206.691.7603
> > > [EMAIL PROTECTED]
> > >
> > > A famous linguist once said:
> > > "There is no language wherein a double
> > > positive can form
This is probably an oldie, but assigning an undef to a hash creates a hash
with a single element (which I'm guessing is undef). Isn't this counter
intuitive. I would have expected the hash to be empty if the undef that is
assigned is in scalar context.
--
To unsubscribe, e-mail: [EMAIL PROTECTE
Thanks Troy and Bob. Your explanation makes perfect sense. I usually
dont code with perl -w, although I know I should and in this case it
would have saved me some trouble.
Bob Showalter wrote:
> > -Original Message-
> > From: Mark Maunder [mailto:[EMAIL PROTECTED]]
> &g
; sub func
> {
> $ref_to_obj = \$_[0];
>
> @array = $$ref_to_obj->get_data();
> }
>
> but Perl says that it can't call method get_data() on an
> unblessed reference. What should I do?
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional
http://www.symantec.com/avcenter/hoax.html
Bernhard <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> - Original Message -
> From: Ann-Louise Hill <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>;
> <[EMAIL PROTECT
d. But, when I try to
decrypt it via command line gpg, I get back a blank
file.
I get the feeling that I'm missing something
fundamentally important here. Please help!
Thanks,
--Mark.
__
Do You Yahoo!?
Get email alerts & NEW webcam
Likewise from us in London. We have been glued to the news for the last two days,
haven't really been able to focus on anything productive. Our thoughts are with you
during this trying
time.
--
Mark Maunder
Senior Architect
SwiftCamel Software
http://www.swiftcamel.com
mailto:[EMAIL PROT
Hi all,
I have sucked two substrings into two variables :
$index = substr $_, 35, 11;
$value = substr $_, 64, 6;
These variables may or may not have leading zero/s :
09/99/000999and so on.
If they do I need to strip away the leading zeros.
Any ideas?
Mark
Hi all,
I have sucked two substrings into two variables :
$index = substr $_, 35, 11;
$value = substr $_, 64, 6;
These variables may or may not have leading zero/s :
09/99/000999and so on.
If they do I need to strip away the leading zeros.
Any ideas?
Mark
> can someone pl tell me what is the best ans to the interview question
>
> "what is tie ?"
In 25 words or less, "Tie lets you attach custom functionality to a scalar,
hash, or array." Common uses of tie include mapping a hash or an array to a
database table so that you can create/search/update
If you're not having
header problems, you can print the standard CGI header, as in #3 above
instead, and you'll see a real web page, possibly with Carp's error messages
if any.
Hope this helps.
Mark Nutter
Manager, Internet Applications Development
Marconi
[EMAIL PROTECTED]
It's not necessarily an advantage to have better brakes than the guy behind
you.
You should be able to use system() for Windows calls that don't return
results, or backticks (``) for calls that do return results. Be aware that
if you specify absolute Windows paths (`dir C:\win2000\system32`), you may
have problems with the backslash being interpreted as an escape character --
Maybe you have a missing dollar sign in front of a variable name? What's on
line 123 of your script?
> -Original Message-
> From: Michael Mitchell [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 19, 2001 4:02 PM
> To: [EMAIL PROTECTED]
> Subject: Debug message
>
>
> Remembering how
Here's some real basic info about hashes...may be useful to newbies...
@ary = ('a', 'b', 'c', 'b', 'a');
%hsh = (); # empty hash
foreach $item (@ary)
{
$hsh{$item} = 1;
}
@ary = keys %hsh;
What does @ary contain now?
You can think of a hash as being like an array that is indexed by st
> What does exactly does use strict do?
Here's a sample:
use strict;
use vars qw( $a $b $c # this is how you declare variables
$myvar ); # for use with "use strict"
$a = 1; #ok
$b = 2; #ok
$c = $a + b; #oops, forgot $ in fro
> foreach $i (@a, @b) # did you know you can combine
> arrays like this?
> :)
Oops, darn line wrap, please ignore the smiley...
with "my" variables that causes them to hold on to
their initial value unexpectedly. You see it sometimes in scripts that have
a user log in--the second person to log in (and everybody thereafter) gets
logged in as the first person who logged in, because a "my" variable held on
h variables from the csv file. I'll probably create those
with a simple split.
any ideas?
Mark
_
Mark Martin
Computer Centre
National University of Ireland Maynooth
Tel: (01)708 4716/3830
Fax: (01)628 6249
what's inside the quotes
(if there are quotes).
Of course, a real HCPH (Hard Core Perl Hacker) would probably do something
more like
while()
{
chomp;
$sth->execute(
grep s/^'?(.*?)'?$/$1/,
split /,/);
}
...which is the same thing without the temporary variables. :)
Mark Nutter
Manager, Internet Applications Development
Marconi
[EMAIL PROTECTED]
It's not necessarily an advantage to have better brakes than the guy behind
you.
> Ok I know what it does ('cause I ran it, see below) but I
> still don't fully
> understand how.
Well, it's a trick, based on the "givens" that neither array contained any
duplicates. If each item appears at most once per array, then all we need
to do is count the number of times each item a
> I hope this helps, and don't forget to read:
>
> perldoc perlmod
> perldoc perlmodlib
> perldoc constant
> perldoc Exporter
Ooo, a bibliography at the end of the specific advice -- that's a *great*
idea for a beginners list. We should make that a convention :)
1 - 100 of 779 matches
Mail list logo