Re: Script for auto conf

2014-12-30 Thread Alan Glait
the line ... now ... how do I test each value ... ?? I will try Andrew approach !! Thanks in advance 2014-12-30 5:40 GMT-03:00 Andrew Solomon : > Hi Alan > > This is the module I'd use for it: > > https://metacpan.org/pod/Config::Tiny > > The simplest approach would be to: &g

Script for auto conf

2014-12-29 Thread Alan Glait
Hi ! I have the Idea to make a perl script (better than in bash) to make some configuration on linux. I think to have some files like param.txt with some lines like: param_one = ZZZ XX VV param_two = Z param_three = X so need to check if param_one is in some_file.conf and if it is the

Re: a condition

2012-08-25 Thread Alan Haggai Alavi
my $select = 0; for ( my @elems = split /\s/ ) { if ( $elems[0] ne $_ ) { $select = 1; } } $select; } @array; Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional comman

Re: subroutine

2012-08-17 Thread Alan Haggai Alavi
(@_); In the above line, `shift` will return just the first element from the @_ array. $y will therefore be undefined. The line should be rewritten as: my ( $x, $y ) = @_; Relevant documentation: `perldoc -f shift` or http://perldoc.perl.org/functions/shift.html Regards, Alan Haggai Alavi. --

Re: In search of a list class with unusual accessors

2011-10-19 Thread Alan Haggai Alavi
27;bar', 'baz' ] ), '$value = [ "bar", "baz" ]' ); @values = $obj->get(); ok( eq_array( \@values, [ 'bar', 'baz' ] ), '@values = ( "bar", "baz" )' ); __END__ Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: GUI Library

2011-09-28 Thread Alan Haggai Alavi
recommend from their experience. Thank you very very much in advance for your time and comments. Have a very nice day. Hello, Francisco, Padre, the Perl IDE, uses wxPerl and is under active development. The latest Wx was released on 06th of June 2011. I recommend it. Regards, Alan Haggai

Re: Good resources on CGI programming with Perl

2011-09-08 Thread Alan Haggai Alavi
Hello Parag, > Could some please suggest any good online resources on learning CGI > programming with Perl Curtis "Ovid" Poe's CGI course is popular: http://web.archive.org/web/20070709150107/http://users.easystreet.com/ovid/cgi_course/ Regards, Alan Haggai Alavi. -- The

Re: GUI Module

2011-08-23 Thread Alan Haggai Alavi
Hello Emeka, > I am thinking of check out GUI ... so I would need to know where to start > off. Is there a GUI module with Perl? Or am I going to pull one from web? Check out WxPerl. Padre, the Perl IDE, uses WxPerl for its GUI. You will have to install `Wx` from CPAN. Regards, Alan

Re: loop break condition

2011-08-22 Thread Alan Haggai Alavi
d why it is always good to label loops that use `last`, `next` or `redo`. Thank you. :-) Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: loop break condition

2011-08-22 Thread Alan Haggai Alavi
Now I want to remove the value > arr[4] and arr[5]. So how it can be done so that $#arr would tell 3. You can use the `splice` function (read: `perldoc -f splice`) for this: splice @array, 4, 2; Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: searching the array

2011-08-22 Thread Alan Haggai Alavi
Hello Anant, Please read: perldoc -q 'certain element is contained in a list or array' or http://bit.ly/o9uKat Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: b

Re: searching the array

2011-08-21 Thread Alan Haggai Alavi
my @array = qw( foo bar quux ); my $item = 'bar'; if ( first { $item eq $_ } @array ) { print "Item found: $item\n"; } Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Useless use of private variable

2011-08-20 Thread Alan Haggai Alavi
ur program can be rewritten as: print join ', ', 0 .. 7; Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Spidering

2011-08-01 Thread Alan Haggai Alavi
p you get started. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: perl's -M

2011-07-22 Thread Alan Haggai Alavi
latter does not import any function except for the ones that have been explicitly listed with the command switch. > which perldoc document is it get descripted in? Command switches are documented in `perlrun`. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsu

Re: very starting help

2011-07-17 Thread Alan Haggai Alavi
interpreter. Consider a script named main.pl which can be executed under unix-like systems as: perl main.pl or ./main.pl # system checks the shebang line for the interpreter to use For more information: http://en.wikipedia.org/wiki/Shebang_(Unix) Regards, Alan Haggai Alavi. -- The difference

Re: Using $variable outside a foreach loop

2011-06-03 Thread Alan Haggai Alavi
Hello, > foreach my $name (split (/, */, $names)) { Here, the scope of $name is limited to the foreach loop and not outside it. So, you will have to declare the variable again for use outside the loop. Regards, Alan Haggai Alavi. -- The difference makes the difference. --

Re: instal

2011-05-22 Thread Alan Haggai Alavi
all? You may try installing Strawberry Perl - http://strawberryperl.com/ Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: perl interview questions

2011-04-20 Thread Alan Haggai Alavi
Hello Jyoti, Please give me any link or any tutorial which will be helpful for preparation of PERL interview. Please read `perldoc perlfaq` (http://perldoc.perl.org/perlfaq.html). It is a collection of frequently asked questions which will certainly help you at an interview. Regards, Alan

Re: Dynamic replacement of the variable

2011-04-19 Thread Alan Haggai Alavi
n build one. As an aside: I am sorry if any uneasiness was caused by my statements. This was inevitable. A proverb for the thoughtful: "Prevention is better than cure". Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Perl source code beautifier

2011-04-18 Thread Alan Haggai Alavi
Hello Bruno, I'm looking for a command line tool for Perl source code beautifier. Have a look at Perl::Tidy. It also includes a script named `perltidy` which can be run from the command-line. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e

Re: WMI

2011-04-16 Thread Alan Haggai Alavi
Hello Mike, Sure enough the module is gone and I can't find it in ActiveState ppm. It is not found in CPAN either. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginn

Re: format output from system command

2011-04-15 Thread Alan Haggai Alavi
Hello Marc, What about writing it like this: open ('FILEOUT', '>>', 'cmdout') ||die "cant open cmdout: $! \n"; Is that O.K.? You are still using a bareword filehandle. Regards, Alan Haggai Alavi. -- The difference makes the di

Re: Help using cgi

2011-04-13 Thread Alan Haggai Alavi
Hello Prashant, Thanx alan.. You are welcome. please suggest the steps to configure my web server. It depends on which web server you are using. You will probably find a cgi-bin directory (in Debian/Ubuntu, Apache's cgi-bin is at /usr/lib/cgi-bin/) which is configured to serv

Re: Help using cgi

2011-04-12 Thread Alan Haggai Alavi
ou have to configure your web server to execute CGI scripts. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: trouble matching words with parentheses using grep

2011-04-09 Thread Alan Haggai Alavi
Hello Mariano, use List::MoreUtils qw( any each_array ); I was experimenting and forgot to take off `each_array` from the import list. `each_array` is not used in the alternative solution and is hence not required. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To

Re: trouble matching words with parentheses using grep

2011-04-09 Thread Alan Haggai Alavi
ever have > questions about molecular biology and genetics, fire away - I'd love > to pay the favor back. Thank you. Hope this message helps. :-) Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Select equivalent in perl

2011-04-07 Thread Alan Haggai Alavi
); my $selected_name = prompt 'Please select one name: ', -menu => \@names; print "Selected name: $selected_name\n"; =cut code Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional com

Re: assigning hash to a scalar

2011-03-26 Thread Alan Haggai Alavi
Hi Sunita, Thanks Alan . I had got this piece of info from google but I do not understand clearly what it wants to define . It would be good , if you can explain bit more . You are welcome. The numbers are dependent on the internal hashing algorithm used by perl of which I am unaware of

Re: assigning hash to a scalar

2011-03-26 Thread Alan Haggai Alavi
sult, since this bucket usage information is currently not available for tied hashes. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Printing Bash and Kernel Version numbers using Perl

2011-03-12 Thread Alan Haggai Alavi
fig_re('^osvers'); $os_version =~ s/^ osvers= | '//gx; print $os_version; =cut Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Printing Bash and Kernel Version numbers using Perl

2011-03-12 Thread Alan Haggai Alavi
Hello Parag, perl -MConfig -le 'print "$Config{perlpath}:$^V\n$ENV{SHELL}: \n/kernel/$^O:"' =pod code perl -MConfig -e 'print "$Config{perlpath}:$^V\n$ENV{SHELL}:" . qx{ bash --version | head -1 } . "/kernel/$^O:" . qx{ uname -r }' =cut R

Re: help with array elements

2011-03-12 Thread Alan Haggai Alavi
nto a hash, updating the count each time: =pod code #!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my @elements = ( 1, 2, 3, 4, 2, 3, 1, 2, 1, 1, 1, 4, 6, 7, ); my %count; $count{$_}++ for @elements; print Dumper \%count; =cut Regards, Alan Haggai Alavi. -- The difference

Re: understanding the ||= operator

2011-02-12 Thread Alan Haggai Alavi
'} = $sheet->{'MinRow'}; } In English: If $sheet->{'MaxRow'} has a value that evaluates to false, make $sheet->{'MaxRow'} equal to $sheet->{'MinRow'}. Though I have left the else clause, By the way, it is not recommended to use `unless` for an

Re: understanding the ||= operator

2011-02-12 Thread Alan Haggai Alavi
$variable_1 || $variable_2. The same applies to: **=+=*=&=<<=&&= -=/=|=>>=||= .=%=^= //= x= Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubs

Re: How to convert EURO Symbol € character to Hex

2011-01-19 Thread Alan Haggai Alavi
l work to all version of windows. > Is there a different between using ASCII or UTF-8? UTF-8 encoding is a super-set of ASCII encoding. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: How to convert EURO Symbol € character to Hex

2011-01-19 Thread Alan Haggai Alavi
source code includes UTF-8 if ( $euros eq 'BC€01' ) { # ... } __OR__ if ( $euros eq 'BC' . chr(0x20AC) . '01' ) { # 0x20AC is the hexadecimal value of € # ... } Regards, Alan Haggai Alavi. -- The difference makes the difference

Re: Function to print Object properties

2011-01-07 Thread Alan Haggai Alavi
o::Bar->new(); my $package = ref $fob; { no strict 'refs'; print Dumper \%{"${package}::"}; } Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail:

Re: need to get parent script name inside child script

2011-01-05 Thread Alan Haggai Alavi
Hi Sunita, > How can I print parent test script name inside this postrun ? `(caller)[1]` will return the the parent script's filename inside the postrun script. See `perldoc -f caller` for more information. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To uns

Re: I can't understand this function that what are parameters ,can you help me?

2011-01-05 Thread Alan Haggai Alavi
due to the `$`). `sub is ($$;$)` Requires two mandatory arguments and an optional one. All of them will be considered in scalar context. See `perldoc perlsub` for more information. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsub

Re: 1st line of perl script

2011-01-04 Thread Alan Haggai Alavi
/Shebang_(Unix) Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Linux Uptime

2010-12-16 Thread Alan Haggai Alavi
rnings; use Unix::Uptime; my $uptime_hours = Unix::Uptime->uptime() / 3600; if ( $uptime_hours < 1 ) { exit(127); } Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

Re: Directory Size

2010-10-28 Thread Alan Haggai Alavi
-f $File::Find::name ) { $size += ( stat $File::Find::name )[7]; } } find( \&determine_size, $directory ); $size /= 1024 * 1024; print "Total size: $size MB\n"; =cut Relevant documents to read: `perldoc File::Find` - http://perldoc.perl.org/File/Find.html `perldoc -f stat`

Re: Perl Threads

2010-10-11 Thread Alan Haggai Alavi
On Sunday 10 Oct 2010 20:38:32 chillidba wrote: > Can some body please point me to Perl Thread tutorials.(some pdf with > examples) Hi, perldoc perlthrtut http://perldoc.perl.org/perlthrtut.html Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe,

Re: Perl Threads

2010-10-11 Thread Alan Haggai Alavi
On Sunday 10 Oct 2010 20:38:32 chillidba wrote: > Can some body please point me to Perl Thread tutorials.(some pdf with > examples) Hi, perldoc perlthrtut http://perldoc.perl.org/perlthrtut.html Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe,

Re: perl

2010-10-05 Thread Alan Haggai Alavi
On 4 October 2010 09:49, sheikh numan iqbal wrote: > i want to login and need help on perl... Hi Numan, Please let us know where you need help with. Consider expanding the question. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginn

Re: Callbacks

2010-09-09 Thread Alan Haggai Alavi
nd's find(). If find() was not implemented to handle callbacks, the possible way to return encountered file/directory names will be as an array or hash of file/directory names after it has traversed and exhausted all possible file/directory names within the path. Regards, Alan Haggai Alavi.

Re: parsing csv

2010-07-02 Thread Alan Haggai Alavi
ran, DBD::CSV is not in core. You can check it yourself by using the `corelist` command-line frontend to Module::Corelist. For example: alanhag...@love:~$ corelist DBD::CSV DBD::CSV was not in CORE (or so I think) By the way, why do you resist installing modules from CPAN? Regards, Alan. --

Re: question abt array

2010-06-30 Thread Alan Haggai Alavi
lue; # @values = ($value); __END__ Please refer `perldoc -f push` and `perldoc -f unshift`. Regards, Alan Haggai Alavi. -- The difference makes the difference -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: about split and \d or . (.)

2010-04-11 Thread Alan Haggai Alavi
ric expression, the result will be undef. > my @elems2 = split(/./,$var); Again, anything is considered to be a delimiter due to the '.' (match anything). Thus, again, the result is undef. > my @elems3 = split(//,$var); When the pattern is omitted, split splits on whitespace.

Re: Modules download from CPAN

2010-04-10 Thread Alan Haggai Alavi
Hi, CPAN::Mini can be used to create/update local mirrors. minicpan script (http://search.cpan.org/perldoc?minicpan) which uses CPAN::Mini will be helpful in maintaining a local CPAN mirror. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail

Re: Decimal representation of binary file (unpack)

2010-04-08 Thread Alan Haggai Alavi
t wondering if I'm missing out on something with > unpack... > > Thanks! > > Ray Hi Raymond, Wildcards can be used within the template in pack. There is no need of the inner loop you have written. For example, to unpack all signed longs: my @signed_longs = unpack ( '

Re: Need help to start with...

2010-04-04 Thread Alan Haggai Alavi
Hi Arjun, >Can someone suggest me some good e-books or tutorials to start >learning PERL? Welcome to the Perl world. :-) By the way, the language is named Perl, and not PERL. For online tutorials and links to books on the Perl language, you can check: http://perl-begin.org/ Regards

Re: error while installing win32::Registry module

2010-03-31 Thread Alan Haggai Alavi
Win32::Registry. So, you need to either install it or add it to @INC for perl to find it. >From checking CPAN, I read that Win32::Registry (http://search.cpan.org/perldoc?Win32::Registry) is now obsolete use Win32::TieRegistry (http://search.cpan.org/perldoc?Win32::TieRegistry) instead. Reg

Re: Perl Beginners

2010-03-12 Thread Alan Haggai Alavi
Hi Sudheer, Some links to help you get started: http://perl-begin.org/ http://learn.perl.org/ Good luck learning Perl. :-) Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners

Re: How to keep script alive if my shell closes

2010-02-13 Thread Alan Haggai Alavi
Hello Ariel, You could use either GNU Screen (http://www.gnu.org/software/screen/) or `nohup` command to run your script. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

Re: Archive::Zip library on Solaris

2010-01-25 Thread Alan Haggai Alavi
rellibmv Hello Bruno, Archive::Zip is a pure Perl module. You can download it from CPAN to some path where you have rw permissions and untar it. Then, modify @INC to use the library. No need to install it. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe

Re: Git Talk by Randal

2009-12-19 Thread Alan Haggai Alavi
>Who are you talking about? Is Merlyn some nickname I'm not aware of? Hi, Merlyn is Randal's nickname. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@

Re: Windoze Woez

2009-12-12 Thread Alan Haggai Alavi
Hi, Windows requires you to use double quotes in place of single quotes. Saving to a file and executing it is the only way that is cross-platform, I suppose. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For

Re: passing command-line arg containing '@'

2009-12-10 Thread Alan Haggai Alavi
ss you tell it otherwise. Check if you are using the EXPR form of eval to modify the argument list. perl -MData::Dumper -le 'print Dumper \...@argv' @this @should @work __Output__ $VAR1 = [ '@this', '@should', '@work' ]

Re: About the perl index function question

2009-12-09 Thread Alan Haggai Alavi
Hi, index $s, "e", 3; This means "position of the first 'e' on or after position 3". The position of the 'e' is counted from the start of the string. Counting starts from 0. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To

Re: Feedback, please

2009-12-09 Thread Alan Haggai Alavi
y perl 5.10. http://perldoc.perl.org/perlsyn.html#Switch-statements Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Can I design a website using Perl

2009-12-06 Thread Alan Haggai Alavi
is a bit hard to deploy. However, the advantages outweigh the disadvantage by a considerable margin. Regards, Alan Haggai Alavi. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Regex to get last 3 digits of a number.

2009-11-24 Thread Alan Haggai Alavi
rldoc website (http://perldoc.perl.org/) can be of help as well. Regards, Alan Haggai Alavi. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

PLEASE STOP SENDING MIALS

2009-07-23 Thread Alok Alan

Re: retreive numbers from alpha-numeric string

2008-09-16 Thread Alan C
while () { @fields = split; foreach (@fields) { next if /\d\)/; # no (X86-64) print "$_\n" if /\d+/; } } __DATA__ Slackware 12.0.0 Welcome to openSUSE 11.0 (X86-64) - Kernel \r (\l). # end of file marker -- Alan.

Re: Extract url and text from a website

2008-09-16 Thread Alan Haggai Alavi
Hi, Do not use regular expressions to parse HTML. Regexps will break at some point. Use HTML::Parser. Regards, Alan Haggai Alavi. -- The difference makes the difference. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: same variable defined twice

2008-05-23 Thread Alan C
On Fri, May 23, 2008 at 12:15 AM, Alan C <[EMAIL PROTECTED]> wrote: > On Thu, May 22, 2008 at 5:57 AM, Octavian Rasnita <[EMAIL PROTECTED]> > wrote: > [ . . ] >Next shows a block or lexical scope (mask does not happen) versus when in the same scope (in global, not usin

Re: same variable defined twice

2008-05-23 Thread Alan C
te scope block) where mask can happen. #!/usr/bin/perl use strict; use warnings; my $text = 1; # begin block next {my $text = 2; print "In block we have ",$text,"\n";} # block ended on previous line # so, next is outside of block print "1st Outside block we have ",$text,"\n"; my $text = 3; print "2nd Outside block we have ",$text,"\n"; # end -- Alan.

Re: log for script

2008-04-18 Thread Alan C
by: M Schilli http://www.google.com/search?q=perlmeister+m+schilli&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a -- Alan.

Re: Howto strip html from a $calar with HTML::Parser

2007-08-03 Thread Alan C
ach my $line (@weather) { # = `weather SAC`; #while () { my $pid; my $readme; $pid = open $readme, "-|", "weather", "SAC" or die "cant fork: $!\n"; print "pid is: $pid\n"; while (<$readme>) { #print if $line =~ /Weather Conditions at/i .. /=/; #print "$line" if $line =~ /Weather Conditions at/i .. /=/; print if /Weather Conditions at/i .. /SAC exec/; #print if /Weather Conditions at/i .. /^\=$/; } #print "\n\n"; #print @weather; } # end --- -- Alan.

Howto strip html from a $calar with HTML::Parser

2007-08-03 Thread Alan C
--- Ultimately, I want to print the CA (California) zone 17 forecast (southern Sacramento valley forecast). Probably will knock that $line + 40 down to $line + 15 or thereabouts. But, I need to strip the html from $source first. Thanks. -- Alan.

Re: Leaving this list.

2007-06-05 Thread Alan
tsoever makes it to my Kmail. Ocasionally I log onto www gmail and "report" spam (the very very very few spam that didn't already get put into the spam folder). -- And, yes, the newsgroup post made it to the list -- made it to my gmail account and got to my Kmail on my Linux KDE desk

Re: numeric and string conversions

2007-03-29 Thread Alan
ctions.html http://perldoc.perl.org/perlop.html http://perldoc.perl.org/perl.html -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Learning Perl with shells operations

2007-03-28 Thread Alan
http://perl.plover.com/FAQs/Namespaces.html http://groups.google.com/group/perl.beginners/search?group=perl.beginners&q=scope&qt_g=Search+this+group http://groups.google.com/group/perl.beginners/search?group=perl.beginners&q=Global+symbol&qt_g=Search+this+group -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Command line fed to Perl was Re: File::Find again

2007-03-26 Thread Alan
On Monday 26 March 2007 07:32, Dave Gray wrote: > On 3/25/07, Alan <[EMAIL PROTECTED]> wrote: > > On Sunday 25 March 2007 18:14, Matt Herzog wrote: > > > This is all I needed. I swear I had " /($searchstring)/; " in there at > > > some point b

Re: File::Find again

2007-03-25 Thread Alan
s even > > > possible? If > > > not, is there a way to exclude directories from being returned? > > This is all I needed. I swear I had " /($searchstring)/; " in there at > some point before . . . so if I pass it > > -s "\.properties$" &

Re: File::Find again

2007-03-23 Thread Alan
if ( /\Q$patc_fil\E$/ ) { # . . . } Someone mentioned the \Q and the \E I've used them. They work. (above, a line from one of my codes). -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: perl -e equivalent of short script...

2007-03-22 Thread Alan Campbell
hello, Good questions. > I'm trying to use cmd line perl -e to do some fairly basic sed-style > find/replace. Why don't you just use sed for that, if you're not doing the main program in Perl? Maybe I'm misunderstanding you, but it sounds like you're saying that you're writing shell scripts in

perl -e equivalent of short script...

2007-03-21 Thread Alan Campbell
$bss_sym); } } print @syms_info; ...but I'd like a (somewhat convoluted perhaps) 1-liner w/ perl -e cmd-liner. Seems like it should be feasible in 1/10th the code. Any thots? Many thanks indeed, Alan -

Re: How to revinent wget?

2007-03-15 Thread Alan
ie "Cannot change working directory ", $ftp->message; #Now list all the files on the remote server and check for foreach my $file($ftp->ls) { next unless $file =~ /.+\.md5$/; # .md5 print $file, "\n"; # $ftp->get($file) or die "Get failed ", $ftp->message; } $ftp->quit; } # end -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to revinent wget?

2007-03-15 Thread Alan
Hi. The orig post of this code did not come to my email -- but the post is on Google Groups. (I'm emailing). I got the code (as enclosed below) working when the url is http. But, ftp://slackware.mirrors.tds.net/pub/slackware/slackware-11.0-iso (ftp), however, does not work which I'd guess is

Re: How to revinent wget?

2007-03-15 Thread Alan
.+(ftp\:|http\:)/$1/ and system("wget $_") if /(ftp|http).+\.md5$/; } # end -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: How to revinent wget?

2007-03-14 Thread Alan
$_ .= "\n"; print NEW; } close(NEW) or die "cant close $urls4dl: $!"; system("wget -i $urls4dl"); # end -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: better way to skip first few lines of file read?

2006-12-28 Thread Alan Campbell
>while $. <= 4; $. is not well-known to many Perl programmers. for 1 .. 4; >>> thanks. Above solution is simple & effective. I agree that I was >>> gratuitously using $. when your solution is far easier to document and >>> probably safer in my program since I have several filehandles op

better way to skip first few lines of file read?

2006-12-27 Thread Alan Campbell
next unless ($. > 4); # only do work if on > 4th line but on a 1 line file thats 9996 wasted operations. In an array I could simply do: - for my $ct (4 .. $#trace_data) { ...the syntax for doing the same thing in line by line I/O escapes me? Anybody know? Many th

any traction on JPL?

2006-09-14 Thread Alan Campbell
(JNI) back to orig COM/C++ methods are not as attractive since all the manpower is going into Eclipse Java APIs. Thanks, Alan - Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+ countries) for 2¢/min or less.

smtp authentication

2006-08-26 Thread Alan Sanders
Tom - Yes I use real values. Dr. Ruud - You're right... the extra line is useless and I have cleaned it up accordingly. Anyways I figured the script out. Here's the final output cleaned up a little bit. Thanks for your help. #!/usr/bin/perl -w use strict; use Net::SMTP; my $mail_server = "

smtp authentication

2006-08-25 Thread Alan Sanders
Hey, I'm trying to send mail over my server (1and1.com). They require smtp authentication in order to send. I'm using windows XP. Here is my code: #!/usr/bin/perl -w use strict; use Net::SMTP; my $mail_server = "mailhost"; my $username = "login"; my $password = "password"; my $msg = "This is

sorting a nested array?

2006-07-20 Thread Alan Campbell
{$a->{typedefName} cmp $b->{typedefName}} @func_recs; ...but with a key-less extra level, how would I go about sorting? Let me know if insufficient data re the problem has been supplied. Thanks, Alan - Do you Yahoo!? Everyone is

RE: Exec a script on one server that will exec other scripts on a different serv

2006-06-16 Thread Alan Reinhold
tpical server-client network communication procedure. The server script would sit in a state in which it is waiting for the other side of the socket to be connect by the client, accept a msg, and then disconnect the client, and what for another connection. Alan From: "William Pauls

Re: reg exp speed?

2006-05-21 Thread Alan Campbell
was faster. Thanks again for all the advice. Much appreciated. FYI the script now runs in 1sec on a 9Mb file, as compared to 3min 30s previously! cheers, Alan "John W. Krahn" <[EMAIL PROTECTED]> wrote: Alan Campbell wrote: > hello folks, Hello, > I'm slurp

reg exp speed?

2006-05-19 Thread Alan Campbell
t welcome. Would also appreciate a brief explanation of why this reg ex is slow (so I dont screw it up next time!) Many thanks, Alan - New Yahoo! Messenger with Voice. Call regular phones from your PC and save big.

Re: 'medium' reg exp greediness?

2006-04-30 Thread Alan Campbell
ed entities from the input XML. I'm open to using a module but pure reg exp (non line-by-line) seems faster...and speed is important in this case due to filesize. Grateful for any ideas u may have. Cheers, Alan Jay Savage <[EMAIL PROTECTED]> wrote: On 4/29/06, Alan Campbel

'medium' reg exp greediness?

2006-04-29 Thread Alan Campbell
e/narrow my search string. Many thanks indeed. cheers, Alan - How low will we go? Check out Yahoo! Messenger’s low PC-to-Phone call rates.

Re: perl with databases

2006-02-19 Thread Alan C
d to compare your need for this versus your need for SQL and then choose which one of the two based on what your needs are. -- Alan.

compile fails at/during the use DB_File; line

2006-02-14 Thread Alan C
783 2005-05-17 16:48 libdbh.la* lrwxrwxrwx1 root root 19 2005-09-27 18:31 libdbh.so -> libdbh-1.0.so.1.0.0* [EMAIL PROTECTED]:/usr/lib$ Oh, BTW: alias lsag='ls -la | grep' -- Alan.

Re: pseudohash

2006-02-11 Thread Alan
+pseudohash&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official Google turned up some hits though I not have time to peruse any of the hits. -- Alan. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: filehandle question

2006-01-18 Thread Alan
line 409. Is that above line with foreach is it a shorthand/substitute for: while ( <$fh> ) { $plain_text .= $_; } # end_of_code ??? yes/no ?? -- And, please of course *do* listen to Mr. Clarkson and Shawn Corey's replies on this thread/issue. -- Alan. -- To unsubscribe,

Re: Maybe Stupid RegEx Question

2004-02-13 Thread Alan Perry
of curiosity though, why not do this: if ( $var2 eq $var1 ) Wouldn't that achieve what you want? Alan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

  1   2   >