Re: Improvements to http://perl-begin.org/

2009-08-14 Thread Offer Kaye
nt crammed in a relatively small area in the middle of the screen doesn't add anything. Regards, -- Offer Kaye -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: argument for Math::MatrixReal

2006-08-22 Thread Offer Kaye
my $array_object=Math::MatrixReal->new_from_cols($ref_AoA); You can test the resulting object using: print $array_object; HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Error handling on script

2006-07-23 Thread Offer Kaye
;$_ =>$name \n"; to: my $name = gethostbyaddr(inet_aton($address), AF_INET); if ($name) { print OUTPUT "$_ =>$name \n"; } else { warn "Can't resolve $address: $!\n"; } HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: FORMAT question

2006-07-05 Thread Offer Kaye
_tran) = @_; format_name OUT "NEWOUT"; format NEWOUT = @<<<<<<<<<<<< @>>>>>>>>>>>>> @>>>>>>>>> @>>>>>>>>>>>>> @

Re: FORMAT question

2006-07-04 Thread Offer Kaye
{ # output table 1, with 3 columns my($id,$num_occur,$msg) = @_; format OUT = @<<<<<<<<<<<<<< @>>>>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<< $id,$num_occur, $msg . write OUT; } sub _print_format2 { # output table 2, with 6 columns my($clock,$skew,$num_ffs,$max_lat,$min_lat,$max_tran) = @_; format NEWOUT = @<<<<<<<<<<<< @>>>>>>>>>>>>> @>>>>>>>>> @>>>>>>>>>>>>> @>>>>>>>>>>>>> @>>>>>>>>>>>>>>> $clock, $skew, $num_ffs, $max_lat, $min_lat, $max_tran . write NEWOUT; } # The End! Hope this helps, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

FORMAT question

2006-07-04 Thread Offer Kaye
her/better solutions? Thanks in advance, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: hex conversion to dec - print and printf differences

2006-04-11 Thread Offer Kaye
entence. But why is "print" behaving differently? I.e., why is the 0x_ not treated as a number? Thanks, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

hex conversion to dec - print and printf differences

2006-04-11 Thread Offer Kaye
> perl -e 'printf "%d\n" ,0x8000_' -2147483648 > perl -e 'print 0x8000_ , "\n"' 2147483648 > perl -e 'print 0x8000_ - 0x1 , "\n"' 2147483647 > perl -e 'printf "%d\n" ,0x8000_ - 0x1' 214748

Re: parsing columns

2005-08-18 Thread Offer Kaye
3... > but that is still using the > assumption that there *must* be at least one space character delimiting > columns. 1. There *must* be at least one space character between columns. 2. Data is guaranteed not to include a whitespace. Regards, -- Offer Kaye -- To unsubscribe, e

Re: parsing columns

2005-08-14 Thread Offer Kaye
On 8/14/05, Manav Mathur wrote: > > How do you logically determine that "l2dat4" in line 2 is column 4 and not > column 2?? > > Manav > Because as a human, I can see they are aligned. I guess a program will have to count whitespace, but then there is the issue of l

parsing columns

2005-08-13 Thread Offer Kaye
tten, I have no control over that... Regards, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Is there any Makefile.pl example?

2005-08-09 Thread Offer Kaye
s for the app installation - deb, rpm or whatever you use. If you would like to write a Makefile.PL for each of the modules distributed with your app so that the modules are installed inside the standard Perl modules installation directories, I suggest reading: http://search.cpan.org/dist/ExtUtils-

Re: popping, shifting or splicing an array???

2005-08-09 Thread Offer Kaye
nt to use depends on what your array looks like and what you want to do. In any case you don't need to "repopulate" the array - both pop and shift change the array itself. Finally, note that "splice" can 'emulate' both operators - see the "splice" per

HaMakor Prize

2005-07-14 Thread Offer Kaye
you aren't a member/friend, you need to register in order to vote. What are you waiting for? ;-) -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Perl training material required.

2005-07-01 Thread Offer Kaye
n advance. > http://perldoc.perl.org/perlintro.html http://perltraining.com.au/notes.html Search Google, many universities have course notes for beginner level Perl courses. Regards, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: [OT] Is there a policy regarding subscrjbers with challenge/respo nse mail filters?

2005-06-08 Thread Offer Kaye
On 6/6/05, Chris Devers wrote: > > Or -- shock horror -- get a gmail / hotmail / yahoo / etc account Why *horror*? Gmail rocks :) Email me if you want an invitation. Cheers, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: E and pod2html translation problem

2005-06-08 Thread Offer Kaye
On 6/7/05, Offer Kaye wrote: > Hi all, > I have a POD file with the following link: > L > podchecker complained about this ("node '$/' contains non-escaped | or > /"), so I looked at "perlpod" and read that I should use "E" > instead

Re: find and replace large blocks

2005-06-07 Thread Offer Kaye
d to escape metachars in the replacement part. Without modifiers (such as "e" or "x") the replacement part is treated as a simple double-quoted string (delimiter dependent). So the s/// can be written as: s|\./officers-gasenate\.html|http://www.legis.state.ga.us/cgi-bin

Re: find and replace large blocks

2005-06-07 Thread Offer Kaye
On 6/7/05, Cy Kurtz wrote: > Is it possible to use s/foo/bar in another way to allow replacement of > large blocks of text with spaces, quotes, and double quotes? > Yes. > Is there a better way? > That depends on what exactly you want to do. HTH, -- Offer Kaye -- To unsu

E and pod2html translation problem

2005-06-07 Thread Offer Kaye
ings? Is this a known Pod::Html bug? Or perhaps a bug in the browsers I used? What can I do to solve this issue (without having to dig into the Pod::Html internals :))? TIA, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

beginners@perl.org

2005-06-06 Thread Offer Kaye
r "hidden" files. > > undef $/; Why? > > return if($_ =~ /^\./); ... > if ( m/$query/i ) { Why use 2 forms for matching $_? Try to be consistent, it really helps readability... > stat $File::Find::name; > Again, why? Especially as you are calling stat in empt

Re: question about appending spaces to each line of a file

2005-06-06 Thread Offer Kaye
perldoc.perl.org/functions/chomp.html). As an experiment, try doing: while (defined(my $line = )) { local $/ = "\r\n"; chomp $line; # rest of code... } HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: regarding problem with $1 in regexec

2005-06-06 Thread Offer Kaye
t; and "D") Maybe it's your Perl version. What is the output of "perl -V"? Try reading "perldoc perlebcdic" http://perldoc.perl.org/perlebcdic.html HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: regarding problem with $1 in regexec

2005-06-06 Thread Offer Kaye
all these is happening only in EBCIDIC platform. in ASCII it is fine. > As I don't have access to an EBCIDIC platform, I can't check this. However this should work: use strict; use warnings; my $bb = "\xa0\xa0\xa0\x{100}" =~ /(\xa0+)/; print "Valid\n" if ($1 eq "\xa0\xa0\xa0"); print "$bb $1\n"; HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: why die; produce an error?

2005-06-06 Thread Offer Kaye
ng script using Devel::ebug and could not quite reproduce this issue. I'm using the latest Devel::ebug version (0.43). Has anyone had any success using this module for debugging work? Cheers, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

Re: why die; produce an error?

2005-06-06 Thread Offer Kaye
tab=wd http://www.google.co.il/advanced_search?hl=iw http://www.google.co.il/preferences?hl=iw http://www.google.co.il/language_tools?hl=iw http://www.google.co.il/intl/iw/about.html http://www.google.com/ncr Died at aaa.pl line 10. ### end output (the die statement is on line 10). So

Re: HOw to pass patterns as function argments?

2005-06-06 Thread Offer Kaye
as an RE, only the first part: s/PATTERN/REPLACEMENT/ PATTERN is a regexp. REPLACEMENT is treated as double-quoted text (delimiter dependent) unless you use the "e" modifier, in which case REPLACEMENT will be eval'ed as a Perl expression. HTH, -- Offer Kaye -- To unsubscribe, e-ma

Re: Search Pattern Question: What does # mean?

2005-06-06 Thread Offer Kaye
cter), so you would have to show us some code that fails with the above pattern. Off-hand I can't think of any reason why "C\#" would match while "C#" would not. Regards, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL P

Re: [OT] Is there a policy regarding subscrjbers with challenge/respo nse mail filters?

2005-06-06 Thread Offer Kaye
vacation message on > their account? I second that. Especially with regards to "anti-spam" messages. Those are pure spam on a moderated mailing list. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Finding matching HTML tags

2005-06-02 Thread Offer Kaye
a Perl tool, I recommend "HTML Tidy": http://tidy.sourceforge.net/ HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: absolute path of current process

2005-05-26 Thread Offer Kaye
::Basename : use Cwd qw(abs_path); use File::Basename qw(dirname); my $path = dirname(abs_path($0)); However please note that the current process may be running in an entirely different directory then the one that hold the executable. To find the current directory, use: use Cwd qw(cwd); my $

Re: How to upgrade local module using -MCPAN?

2005-05-25 Thread Offer Kaye
quot;upgrade" might cause you to have 2 versions of certain files, but for most cases a simple: cpan> install Module::Name should work. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: output in a single line

2005-05-25 Thread Offer Kaye
t;my" instead of "our". Don't use globals without a good reason, it's a bad habit :-) Cheers, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Process Running Time

2005-05-25 Thread Offer Kaye
Oops- replied to wrong list :) Please ignore... -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Process Running Time

2005-05-25 Thread Offer Kaye
Perl debugger to help you pin-point the problem. Write a test-case with minimal code and data that shows the problem, and post that to this list. Then maybe someone can help :) HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <h

Re: while loop -> map

2005-05-24 Thread Offer Kaye
m; my @bar = map {$sum+=1+length} split(/e/,$foo); print join(":", @bar[0..$#bar-1]) . "\n"; It is however a bit forced. I would stick to the "while" - much more readable :) Cheers, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: hash reference help

2005-05-24 Thread Offer Kaye
email you wrote: "and get_something() change the hash" That's a no-no according to "perldoc -f each": "If you add or delete elements of a hash while you're iterating over it, you may get entries skipped or duplicated, so don't." Cheers, -- Offer Kaye -- T

Re: undefined...

2005-05-23 Thread Offer Kaye
ded... I am thinking that somehow maybe the perl > compiler/interpreter is > doing some optimzation that is different when the "size" of your perl program > is at a different > size > No. Never. At least, not AFAIK. Maybe one of the list gurus can say otherwise. Cheers,

Re: undefined...

2005-05-22 Thread Offer Kaye
CTED]); Just before you pass @data to GD::Graph::Boxplot. You should see which values are undefined, although perhaps that will not help you to understand why they are not defined. You might also want to try out the Devel::ebug module, it's very nice :) http://search.cpan.org/dist/Devel-ebug/ H

Re: foreach loop current index

2005-05-21 Thread Offer Kaye
nter > accessible from inside the loop? I was unable to find anything related in > perlvar. > Neither was I, but I suspect the reason is that if you need a counter, you should not be using "foreach". Instead, use "for": for(my $counter = 0; $counter < @array; ++$co

Re: undefined...

2005-05-21 Thread Offer Kaye
, explain exactly what you were expecting and what the problem is, and *then* we can help. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: assigning printf statement to an array

2005-05-21 Thread Offer Kaye
quot; instead of "printf". Read "perldoc -f printf" and "perldoc -f sprintf" from your command-line, or online: http://perldoc.perl.org/functions/printf.html http://perldoc.perl.org/functions/sprintf.html HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTEC

Re: Input template for data File

2005-05-19 Thread Offer Kaye
mplating solution, can be used for any problem where a template is needed. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: using Mail::Sender

2005-05-19 Thread Offer Kaye
get a "Local user "[EMAIL PROTECTED]" unknown on host "zzz"" message... it only accepts messages to or from a local user." Maybe your server doesn't like '[EMAIL PROTECTED]' as a from field? More likely, 'user' is not a valid email - try

Re: using Mail::Sender

2005-05-19 Thread Offer Kaye
y for? Surely all you need is a host, username and password? > If indeed you are using a login method (username and password), then replace "NTLM" with LOGIN. So instead of: >auth => 'NTLM', Use: >auth => 'LOGIN', HTH, -- Offer Kaye -- To u

Re: Emulate "tail -f" on file

2005-05-18 Thread Offer Kaye
rl.org/perlfaq5.html#How-do-I-do-a-tail--f-in-perl- -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: XML

2005-05-18 Thread Offer Kaye
ually looping over your data. In that case I suggest you start looking at XML modules that provide OO access methods to your data, such as XML::SimpleObject : http://search.cpan.org/dist/XML-SimpleObject/SimpleObject.pm That's just a suggestion, there are of course many others out there :-)

Re: seek(FH, 0,0) not working

2005-05-08 Thread Offer Kaye
e. 1. You should move the seek inside the "if". 2. Even after fix (1), your program will be stuck in an infinite loop, since every time it will reach the last line it will jump right back to the first line. Use a flag, condition or other mechanism to make sure you loop through the file o

Re: The last element

2005-05-07 Thread Offer Kaye
ttp://perldoc.perl.org/perldata.html (everything about Perl data types) http://perldoc.perl.org/perlintro.html (Perl Introduction - a great beginner resource) You can also read these from your command-line using the "perldoc" command. Try "perldoc perl". HTH, -- Offer Kaye -- To

Re: How would I simulate this in Perl?

2005-05-06 Thread Offer Kaye
the output of running "perl -V" from the command line. Also please paste the exact contents of test.pl. Regards, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Writing my first perl script

2005-05-06 Thread Offer Kaye
for details: http://perldoc.perl.org/perlsyn.html (about the "while" flow control keyword) http://perldoc.perl.org/functions/defined.html (about the "defined" function) http://perldoc.perl.org/perlop.html#I-O-Operators (about the "" construct) * Line 15 - this time we w

Re: How would I simulate this in Perl?

2005-05-06 Thread Offer Kaye
d code Read the documentation of File::Find for more details about using this module. You can read from your locally installed Perl documentation (i.e. "perldoc File::Find from the command line), or online at: http://perldoc.perl.org/File/Find.html HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: problem using regular expressions

2005-05-03 Thread Offer Kaye
ork. Here's a correct version: my $address = '[EMAIL PROTECTED]'; my ($domain) = $address =~ m/\@(.+)/; And one more, using s/// instead of m// : my $address = '[EMAIL PROTECTED]'; (my $domain = $address) =~ s/^.+?\@//; -- Offer Kaye -- To unsubscribe, e-ma

Re: Question about || (was REGEXP removing - il- - -b-f and - il- - - - f)

2005-04-27 Thread Offer Kaye
($/); > > ,I have no idea how it undefs $/. Points to a good reading on the > subject are equally appreciated. > It declares $/ to be local without giving an init value. So now $/ has the value of "undef". This isn't specific to $/ - local will do the same to any va

Re: Edit Windows PATH

2005-04-27 Thread Offer Kaye
change the PATH for the rest of the script (and any sub-processes launched by it). Someone else will have to help you if you want to change the system's PATH, I don't know how to do that. Perhaps you should clarify what you meant. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROT

Re: Hello

2005-04-27 Thread Offer Kaye
On 27 Apr 2005 11:34:21 -, laxmi goudappa patil wrote: > Hello.. > Im new to the Perl.. Post some code, no one will be able to help you otherwise. Also, "Hello" is a bad subject for an email to this list. Please use a more meaningful subject in the future. -- Offer Kaye -

Re: regex substitution

2005-04-27 Thread Offer Kaye
gth" for an explanation of the length function. Some example code: ## begin code use strict; use warnings; while () { chomp(my $orig = $_); s/-(-+)/"-".("x"x length$1)/ge; print "$orig > $_"; } __DATA__ bla - Ram -- bla bla --- -- blah --- ## end code HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: REGEXP

2005-04-26 Thread Offer Kaye
these lines in it: > > -o-b- - - -f > F01045 Meaningless question subject, obscure question, some strange code and data thrown in - it's like you don't *want* to get an answer ;-) -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EM

Re: Re: Number with More then 15 Digits.

2005-04-26 Thread Offer Kaye
way, Depending on your needs, you can use "%s" as the printf format string, or use simply print: begin code use strict; use warnings; use Math::BigInt; my $num = Math::BigInt->new("12345678901234567890"); print "Orig string: 12345678901234567890\n"; p

Re: Some part of the text should not be converted

2005-04-26 Thread Offer Kaye
On 4/26/05, N. Ganesh Babu wrote: > Dear Offer Kaye, > > I want to preserve the tag also in the context. Can you help me how to > do it. If you run 2nd time also the same action will happen. If we remove, > in the 2nd execution again the conversion will take place on these

Re: Number with More then 15 Digits.

2005-04-26 Thread Offer Kaye
;. Anyway, you can use Math::BigInt to handle large integers. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: core in perl??? i am not sure where to report this...

2005-04-26 Thread Offer Kaye
On 4/26/05, Manish Sapariya wrote: > [EMAIL PROTECTED] gdb /usr/bin/perl core.24670 > GNU gdb Red Hat Linux (5.2.1-4) Read "perldoc perlbug" -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://lea

Re: Some part of the text should not be converted

2005-04-26 Thread Offer Kaye
if any of the gurus on the list could shorten: my @un; $line=~s!(.+?)!push @un,$1;""!ige; To a single line. Unlike "m//", "s///" never seems to return the results of "()" in the RE, even in list context. Annoying :-( HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Very basic question about running perl cgi on tomcat

2005-04-26 Thread Offer Kaye
On 4/25/05, Robert Kerry wrote: > What should I do? Thank you. > You should use Google :-) The first link returned by searching for "Tomcat" and "Perl": http://www.ftponline.com/javapro/2003_03/online/perl_teden_03_18_03/ HTH, -- Offer Kaye -- To unsubscribe, e-m

Re: Configuration File generator

2005-04-25 Thread Offer Kaye
s, you are better off using the Automake and Autoconf tools from the GNU Foundation: http://www.gnu.org/software/automake/ http://www.gnu.org/software/autoconf/ Automake itself is written in Perl. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-m

Re: Getopt::Mixed

2005-04-25 Thread Offer Kaye
ldoc.perl.org/Getopt/Long.html The documentation is very clear, you should be able to whip up a working example very quickly. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Require / Use

2005-04-21 Thread Offer Kaye
On 4/21/05, Paul Kraus wrote: > Why would one use Require instead of Use? > Because you want the action at run-time (require) vs. compile time (use), is the usual reason, I would guess. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail:

Re: WhiteSpace - Map, search replace, split

2005-04-21 Thread Offer Kaye
'o', 't', 'h', 'r', 'e', 'e' ]; As you can see, your version doesn't work correctly. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Script that spans multiple files

2005-04-20 Thread Offer Kaye
e_foo.pl contents $VERSION is an example of a variable in Foo.pm accessible from an external script, and munge() is an example of such a function. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread Offer Kaye
On 4/21/05, FreeFall wrote: > > 3. But there's an even easier way, without having to use map: > > my @record = split /\s*\|\s*/,$date; > > -->this seems it cant delete spaces of the last element. > Have you tried it? -- Offer Kaye -- To unsubscribe,

Re: Holidays

2005-04-20 Thread Offer Kaye
because they can shift for year to year. Do you know of a resource I can > look at? > I know of: http://www.sadinoff.com/hebcal/ http://search.cpan.org/dist/Date-Holidays/ HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] &

Re: Need help match feet and inches

2005-04-20 Thread Offer Kaye
;7" 7'10" x 16' 83' X 40" 17' x 50' 5' X 90'6" 39" X 100" 30" x 12' 28-3/8" x 14'4" 16' 6-3/4" x 43" 21'3 1/2" x 24' 14'8.5" x 16'7" # end code If anything in the code isn't clear, please don't hesitate to ask. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: WhiteSpace - Map, search replace, split

2005-04-20 Thread Offer Kaye
ow constitutes the return value. 3. But there's an even easier way, without having to use map: my @record = split /\s*\|\s*/,$date; HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: GetOpt::Long

2005-04-20 Thread Offer Kaye
On 4/20/05, Olivier, Wim W wrote: > Hi all, > > Is it possible to use GetOpt::Long (or something similar) in a subroutine Getargs::Long - http://search.cpan.org/dist/Getargs-Long/ HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mai

Re: regex lying to me

2005-04-19 Thread Offer Kaye
> bemused Angie > Metachars in the results perhaps? Have you tried dumping @tables using Data::Dumper and looking at the results? Try using quotemeta (http://perldoc.perl.org/functions/quotemeta.html): my $table = quotemeta; HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Reading last 10 lines in file on Win32 Systems

2005-04-19 Thread Offer Kaye
rint $array[-$_] . "\n"; } # end code It is much faster because it doesn't read the entire file into memory, or go over all of it just to get to the last 10 lines. Just be careful - Tie::File lets you also modify the file, if you want. Read: http://perldoc.perl.org/Tie/Fil

Re: sub declarations

2005-04-19 Thread Offer Kaye
ogle search box the following string: search_term site:perldoc.perl.org -filetype:pdf HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: What is the best way to release memory from data structure?

2005-04-19 Thread Offer Kaye
se fails, you might consider using tied hashes. Read: http://perldoc.perl.org/functions/tie.html and http://perldoc.perl.org/Tie/Hash.html [1] http://search.cpan.org/dist/Devel-Size/ [2] http://search.cpan.org/dist/Devel-Monitor/ HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: mkdir? system? split?

2005-04-19 Thread Offer Kaye
File::Path, that can be used to create a directory tree: http://perldoc.perl.org/File/Path.html -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Match a pattern

2005-04-19 Thread Offer Kaye
On 4/19/05, lio lop wrote: > I need to print the text between two words > that are in different > lines. > print "\n"; -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http

Re: Multiple programs output to separate log files + to STDOUT

2005-04-19 Thread Offer Kaye
r my $program (@progs) { my $tee = new IO::Tee(\*STDOUT, new IO::File(">$program.log")); print $tee `$program`; } # end code HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Capatalisation Question

2005-04-18 Thread Offer Kaye
On 4/18/05, Jay Savage wrote: > > $line =~ /(\S+)/\u\L$1/g ; > Almost right - returns "Level A (grade 1 Reading Level)" - notice the lowercase "g" in "grade"). Should be: $line =~ s/(\w+)/\u$1/g; -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PRO

Re: Capatalisation Question

2005-04-18 Thread Offer Kaye
t;; for (split /(\s+)/,$line ) { $ucline .= ucfirst($_); } print "$ucline\n"; ## end code Of course this means the ucfirst function will also operate on whitespace, but this doesn't do any harm. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: error

2005-04-16 Thread Offer Kaye
bottom is: begin quote * print "# Perl header `$_' does not appear to be properly installed.\n"; Correct by running h2ph over your system's C header files. If necessary, edit the resulting *.ph files to eliminate perl syntax errors. ###

Re: Active Directory and Perl advice

2005-04-14 Thread Offer Kaye
anks in advance. > Google "active directory perl" (without the double quotes), you'll find lots of good resources, e.g.: http://www.rallenhome.com/books/adcookbook/code.html http://isg.ee.ethz.ch/tools/realmen/det/adsi.en.html http://www.perl.com/pub/a/2001/12/19/xmlrpc.html HTH,

Re: setting variable in certain cases

2005-04-14 Thread Offer Kaye
> > So is there a better way to do it? > Why not use method #2 and use the @cases array for the actual case statements? E.g.: case ($cases[0]) { ... } Note- the parens around $cases[0] are not optional, since this method uses a variable as the first argument to "case". HTH,

Re: Preventing CPU spikes / was switch confusion

2005-04-13 Thread Offer Kaye
On 4/14/05, David Gilden wrote: > use strict; Where is "use warnings;" ? It seems to be missing ;-) > use switch; Shouldn't that be "use Switch;" (with a capital "S")? Read "perldoc Switch", the usage syntax is well documented there. -- Offe

Re: Searching for embedded EOF in binary

2005-04-13 Thread Offer Kaye
On 4/13/05, Jay Savage wrote: > Hi, all: > > Below is a script to extract jpegs from an image of a corrupted or > accidentally erased CF or other removable media from a digital camera. Here's another one, found by Googling. Maybe it will help: http://www.zinkwazi.com/tools/jpg-r

Re: Searching for embedded EOF in binary

2005-04-13 Thread Offer Kaye
take everything from one $magic to the next, if you assume multiple jpegs in one file, instead of looking for the EOI (since you can't find it)? Each such block will then be, I assume, a (possibly corrupt) jpeg. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

Re: Citation Parsing

2005-04-13 Thread Offer Kaye
through the RT system. -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Is this allowed?

2005-04-07 Thread Offer Kaye
rid of empty last and first elements: shift @checks; pop @checks; print(OUTPUT "Cheque Debits @checks\n"); print(OUTPUT "Current Balance: "); for (@checks) { $balance -= $_; print(OUTPUT "$balance "); } print(OUTPUT "\n"); end code -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Converting a retruned string value to a number

2005-04-06 Thread Offer Kaye
general, conversion from a string to a number is transparent in Perl. "4" is the same as 4. HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: a module query

2005-04-06 Thread Offer Kaye
rg/perlboot.html#A-few-notes-about--ISA Then read this: http://perldoc.perl.org/perlobj.html#A-Class-is-Simply-a-Package HTH, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Regular expression $1,$2,$3 ... in array ?

2005-04-05 Thread Offer Kaye
d the "s" modifier to make "." match a newline. > 2. It breaks it up into parts, $1,$2,$3,$4, etc. Can I save the > parts into an array ? Simply assign the result of the match to an array: my @arr = /(\/\S*).+?\((\d+)/sg; -- Offer Kaye -- To unsubscribe, e-mail: [EM

Re: initialize arrays

2005-04-05 Thread Offer Kaye
so, we > could use that to see what Perl does with those two different > assignments above. > Seeing is one thing; understanding - that's quite another thing ;-) -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http:/

Re: Lost here.. Use of uninitialized value in print?

2005-04-04 Thread Offer Kaye
ariable $list1. What were you trying to do? -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Frustration - split not working as expected

2005-04-01 Thread Offer Kaye
to do with it. This behaviour is due to "die". From "perldoc -f die": If the last element of LIST does not end in a newline, the current script line number and input line number (if any) are also printed, and a newline is supplied. Hope this helps,, -

Re: Frustration - split not working as expected

2005-04-01 Thread Offer Kaye
ist != 1 must be wanted lines. $pricelist[1] is the second element of the array @pricelist. If you need to know more, read "perldoc perlintro", it is a very good introduction to Perl's syntax, variables, etc. The reason the number we want is in the second and not first element h

Re: quick regex question

2005-03-31 Thread Offer Kaye
7; a b c d $ perl -le' @) = qw/ a b c d /; print for "@)"' @) Now all is well :-) But now I'm confused - if you knew of the above rule, why take me to task for not escaping the '@' sign in my code? Regards, -- Offer Kaye -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: quick regex question

2005-03-31 Thread Offer Kaye
1 while $str =~ s/(?<=@)(.+?)_/$1./; Go ahead and try it - I promise you it works. I don't know where this is documented*, so I can't prove this, but at least as far as the code, it works. So do my solutions, BTW - I tried them before posting. * If you or anyone else knows where thi

  1   2   >