Re: Date::Manip DateCalc

2013-03-29 Thread Grant
business days"); But I'd rather set the mode explicitly. The documentation says the following are equivalent: $date=&DateCalc("today","+ 2 business days",\$err); $date=&DateCalc("today","+ 2 days",\$err,2); http://www.fnal.gov/docs/p

Date::Manip DateCalc

2013-03-29 Thread Grant
",3); my $date = UnixDate($unparsed_date,"%Y%m%d"); returns 20130405. Changing to "+ 7 days" returns 20130404 instead of the expected 20130408. Today is 20130328. Does anyone know why this is happening? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@per

Save contents of double-quotes to a variable?

2012-06-16 Thread Grant
any thanks to anyone who can show me how to do this. - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Hash or array & retrieving hash value

2011-06-16 Thread Grant
;  ForceArray => ['Image'] I tried that and it seems to behave the same as 'ForceArray => 1'. Everything seems to be forced into an array. > For further help you must show more of your source XML and examples of > the two forms of Perl data structure that you are seeing. I'm very happy to report that I got it working by using 'ForceArray => 1' and specifying [0] to pick the first (and what should be the only) value from all of the new arrays. I'm now using $parsed_response->{Label}[0]->{Image} in the foreach loop. Is that a good solution? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Hash or array & retrieving hash value

2011-06-15 Thread Grant
tting. If I set 'ForceArray => 1', everything seems to be forced into an array but I don't want to loop with foreach for every value I want to retrieve. I'd like to force only $parsed_response->{Label}->{Image} into an array but I can't find the correct setting for ForceArray. - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Hash or array & retrieving hash value

2011-06-15 Thread Grant
a hash. I also need to be able to decide if it's a hash or an array so I can execute the appropriate code for retrieving the value. Can anyone show me how to do this? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: regex for matching Google URLs

2011-01-17 Thread Grant
s URLs of which this is one example: > > www.google.com/url?sa=t&source=productsearch > > but my pathetic regex "skills" aren't cutting it.  Can anyone help me > out?  Is there a perl module for this? > > - Grant I came up with these but they don't see

regex for matching Google URLs

2011-01-17 Thread Grant
?sa=t&source=productsearch but my pathetic regex "skills" aren't cutting it. Can anyone help me out? Is there a perl module for this? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Simple Script That Runs Under Perl 5.8 but not under Perl 5.10

2010-11-23 Thread Greg Grant
The following script runs on 5.8 but does not run on 5.10. I distilled out a short program with the heart of the bug. The output of this script could be achieved easily without recursion but my real sort routine does need to be recursive, but I removed most of the code. Ignore the fact that this d

Any google-api-adwords-perl users?

2010-07-07 Thread Grant
t a simple example? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: split value when there's nothing to split

2010-05-30 Thread Grant
=~ /(.*?)-/ ? $1 : ""; # $foo will be "" if there is no > match This seems to work great, thanks! - Grant > In fact, there appears to be a bug in your code: the 1 or more > modifier (+) is outside of the parentheses, so you only get the last > character of t

split value when there's nothing to split

2010-05-27 Thread Grant
e no dashes in the string: $foo = (split('-',$string)),[0]; Can anyone tell me why this is happening? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Is "lc(or)" something special?

2010-01-27 Thread Grant
) >> >> Which makes me think lc(or) might have some type of special meaning >> that I need to escape.  Does it, and if so, how can I escape it? >> >> - Grant >> > > It looks like your script is being eval'ed by another.  Is this part of > a CG

Is "lc(or)" something special?

2010-01-27 Thread Grant
g that I need to escape. Does it, and if so, how can I escape it? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: XML::Simple parsing with attributes

2010-01-16 Thread Grant
mber" attribute >         open my $FH, '>', $filename or die $!; >        flock $FH, LOCK_EX or die $!; >        print $FH $image->{content} or die $!; >      close FH or die $!; > } Thank you, I've adapted that and will test ASAP. I'd like to use a filename like: my $filename = $var_name"_static_portion_"$image->{Number}.pdf where $var_name is the name of a variable. Is my above syntax correct? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: XML::Simple parsing with attributes

2010-01-16 Thread Grant
t;{content}\n"; > } > > Gives out > > base64datahere > base64datahere > base64datahere Thanks Erez, I will stick with XML::Simple for now. I need to save each set of base64data to a separate variable, so I can save each to a separate file. How can I save each to a separate variable? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: XML::Simple parsing with attributes

2010-01-16 Thread Grant
real parser. Avoid > XML::Simple (see the xml::simple factoid). Choices are ::Easy, ::Smart, ::Twig Thanks, which of these would you use? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

XML::Simple parsing with attributes

2010-01-15 Thread Grant
Anybody here familiar with XML::Simple? I need to parse some XML that looks like this: base64datahere base64datahere base64datahere I need to be able to grab the correct set of base64 data. Does anyone know how to do that? - Grant -- To unsubscribe, e-mail: beginners-unsubscr

$Sql{mydata} fails?

2009-12-12 Thread Grant
ginal file which was working before I started modifying it. - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

How to analyze a URL string?

2009-12-05 Thread Grant
at those numbers are if they are included? It would also be great to detect any kind of garbage in the URL that goes outside of this format so I can return a 404. - Grant P.S. The second variant above could be changed to the following if it is better for analysis: /page-name-1-2.html -- To

Re: Remove zero from 01, 02, etc.

2009-08-20 Thread Grant
to > us and yourself to post it. your quoted error made no sense to me given > what you also said. > > thanx, > > uri I use interchange (icdevgroup.org) and things like this always trace back to the extra layer. Please let me know if that is satisfactory. - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Remove zero from 01, 02, etc.

2009-08-19 Thread Grant
ro? > > use warnings; > use strict; > > my @numbers = qw ( 01 02 03 04 05 ); > > for my $num (@numbers) { >        $num = int $num; >        print "$num\n"; > } > > Steve That got it. Thank you Steve and Uri. - Grant -- To unsubscribe, e-mail: beginners-un

Remove zero from 01, 02, etc.

2009-08-19 Thread Grant
I have a variable which could contain any number from 01-12. I need to remove the leading zero from numbers 01-09, otherwise I get an "octal digit" error when the number is used in a calculation. Can anyone show me how to remove that leading zero? - Grant -- To unsubscribe, e-mail:

Re: String manipulation question

2009-04-21 Thread Grant
for ad text. I'm working with the Google::Adwords CPAN module. > If there are no spaces in the first 35 characters of $string, then $var = > $string. Just so I'm clear, $var1 = $string in that case right? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: String manipulation question

2009-04-21 Thread Grant
g) == 34 ) { $var1 = $string . ':' } >> >> >> > >> >> >> >> if(length($string) > 34) { >> >> >> >>   $string =~ s/\s//g; >> >> >> > >> >> >> > The above line deletes all of the s

Re: String manipulation question

2009-04-21 Thread Grant
t;> >> if(length($string) > 34) { >> >> >>   $string =~ s/\s//g; >> >> > >> >> > The above line deletes all of the spaces in $string. Is >> >> that what you want >> >> > to do? >> >> >> >>

Re: String manipulation question

2009-04-21 Thread Grant
gt;> > The above line deletes all of the spaces in $string. Is >> that what you want >> > to do? >> >> All fixed up except for this.  How can I remove only the spaces at the >> end of $var1 and $var2 if they exist? >> >> - Grant >> >> &g

Re: String manipulation question

2009-04-21 Thread Grant
gt; > Anchor your substitution regular expression to the end of the string: > >    $var1 =~ s/\s+$//; > > This will delete any whitespace characters at the end of $var1. That worked great, thank you Jim. - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: String manipulation question

2009-04-21 Thread Grant
ality. Change the above > line to: >    if( length($string) == 34 ) { $var1 = $string . ':' } > >> if(length($string) > 34) { >>   $string =~ s/\s//g; > > The above line deletes all of the spaces in $string. Is that what you want > to do? All fixed up except

Re: String manipulation question

2009-04-21 Thread Grant
guys. With some help I've come up with this: $string = 'abc def ghi jkl mno pqr stu vwx yz'; if(length($string) = 34) {$var1 = $string.":";} if(length($string) > 34) { $string =~ s/\s//g; ($var1, $var2) = $string =~ /(.){35}(.){26}/; $var2 .= ":"; } but I get

String manipulation question

2009-04-21 Thread Grant
the variable. $var2 should have an appended colon character. Is that a tall order? I'm hoping it's trivial for someone here. Thanks, Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Bareword "Google::Adwords::Campaign" not allowed while "strictsubs" in use

2009-04-20 Thread Grant
To: >> >> my $campaign = Google::Adwords::Campaign->new(); > > I see that the the SYNOPSIS sections of both the Google::Adwords::Campaign > POD and the Google::Adwords::CampaignService POD say something else. Such > mistakes makes me doubt the quality of those modules. Got it, thanks guys. - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Bareword "Google::Adwords::Campaign" not allowed while "strict subs" in use

2009-04-19 Thread Grant
gn = Google::Adwords::Campaign; I get: # ls /usr/lib/perl5/vendor_perl/5.8.8/Google/Adwords/Campaign.pm /usr/lib/perl5/vendor_perl/5.8.8/Google/Adwords/Campaign.pm Does anyone know why this is happening? - Grant -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: piece of Perl code needed for tracking clicks

2008-12-09 Thread Terry Grant
or die ("Could not open!"); $num_hits = ; close COUNT; $num_hits++; open COUNT, ">$counter_log" or die ("Could not open file for writing!"); print COUNT $num_hits; close COUNT; -Terry Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: removing an arbitrary element from array

2008-12-05 Thread Terry Grant
t). Then if you needed all of that data back into the original array format you could dump this hash back into the array (minus the one you removed of course). I hope this helps, provided I understood the problem correctly. If not let me know and I'll try to help further. Terry

Re: Switching two characters

2008-09-22 Thread Grant
; without the double-quotes. Can that be done as simply as >>> your one-liner above? >> >> perldoc HTML::Entities >> >> Or: http://search.cpan.org/~gaas/HTML-Parser-3.56/lib/HTML/Entities.pm > > Is there a way to switch ' and ' without going through the > HTML-Entities module? > > - Grant No? There must be! :) - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Switching two characters

2008-09-22 Thread Grant
Can that be done as simply as >> your one-liner above? > > perldoc HTML::Entities > > Or: http://search.cpan.org/~gaas/HTML-Parser-3.56/lib/HTML/Entities.pm Is there a way to switch ' and ' without going through the HTML-Entities module? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Switching two characters

2008-09-22 Thread Grant
s. Can that be done as simply as >> your one-liner above? > > $code = s{ (['\x22]) }{ '&#' . ord( $1 ) . ';' }egx; Thanks but I don't follow. How does it work? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Switching two characters

2008-09-22 Thread Grant
> what about > > $code =~ tr/['"]/["']/; > > ? I shouldn't have said characters. I'm actually trying to switch "'" and "'" without the double-quotes. Can that be done as simply as your one-liner above? - Grant >

Switching two characters

2008-09-22 Thread Grant
the other: $code =~ s/"/'/g; $code =~ s/'/"/g; Is there any way to switch them simultaneously? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

lpr within perl

2008-02-01 Thread Grant
I am able to print from my remote server to my local printer server perfectly with 'lpr file.pdf'. I'd like to be able to do that from within a perl script. What is the simplest way? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

Re: Regexp non-alphanumerics to spaces

2007-03-30 Thread Grant
be happy with just the "." character. Hi Grant. $text =~ s/[^[:alnum:]]/ /g; $text =~ s/\s+/ /g; will do what you want. Works like a charm. Thanks Rob! - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Regexp non-alphanumerics to spaces

2007-03-30 Thread Grant
quot; character. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Prepend + to search words

2007-03-29 Thread Grant
ng me really quickly. Can you show me how? $ perl -le'$_ = "big blue widgets"; print; s/(\w+)/+$1/g; print' big blue widgets +big +blue +widgets Thanks guys, work perfectly. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Prepend + to search words

2007-03-29 Thread Grant
sign and the word. Have you tried that? Hi Tom, I just had a look at some docs matching "perl substitution variable" since the words in the string could be anything, but perl docs have a way of overwhelming me really quickly. Can you show me how? - Grant -- To unsubscribe, e-m

Prepend + to search words

2007-03-29 Thread Grant
Hello, how can I prepend a "+" character to each of the words in a string? For example, "big blue widgets" should be changed to "+big +blue +widgets". - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Generating random numbers

2007-03-16 Thread Grant
Hello, I need to generate two random numbers. One should be a 1, 2, or 3, and the other should be a 1 or 2. How can I do that? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Module for pulling actual queries from search engine URLs?

2007-03-16 Thread Grant
Oh man that looks perfect. Thanks Tom! - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Grant
as Randal did suggest. Won't URI and uri_split and $query give me the entire query string instead of just the search term used? I'm trying to pull "blue widgets" from this string in my DB: http://www.google.com/search?hl=en&q=blue+widgets&btnG=Google+Search

Re: Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Grant
as Randal did suggest. Has anyone used URI and uri_split and $query for something like this? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Matching the domain of a URL

2007-03-15 Thread Grant
x27;re right, I hadn't grasped what URI was about before. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Matching the domain of a URL

2007-03-15 Thread Grant
he match case insensitive. Host names ARE case insensitive. Thanks Jenda. I ended up going with this: if ($Scratch->{url} =~ /^https?:\/\/images\.google\./) { Does that look OK? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Module for pulling actual queries from search engine URLs?

2007-03-15 Thread Grant
Does anyone know of a perl module for pulling the actual search queries from search engine URLs? It seems like writing a good regexp for that would be pretty tough. The URLs vary a lot. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Matching the domain of a URL

2007-03-14 Thread Grant
My fault. The reason it does not match is the colon placement. It will match http//:images.google. Thanks, I really should have noticed that myself. - Grant > Can you correct my syntax? I can't get this to match: > > if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) {

Re: Matching the domain of a URL

2007-03-14 Thread Grant
regex. if ( m/^https?\/\/:blah\.com/) Can you correct my syntax? I can't get this to match: if ($Scratch->{url} =~ /^https?\/\/:images\.google\./) { The value of referrer is exactly: http://images.google. - Grant > Hello, I need to do some special processing if the doma

Re: Matching the domain of a URL

2007-03-14 Thread Grant
regex. if ( m/^https?\/\/:blah\.com/) Ok, how can I pass in the value I want evaluated? Sorry I'm such a beginner. - Grant > Hello, I need to do some special processing if the domain of a URL > string matches a set of possible values. I'd like to catch http and > https

Matching the domain of a URL

2007-03-14 Thread Grant
Hello, I need to do some special processing if the domain of a URL string matches a set of possible values. I'd like to catch http and https. What is the best way to do that? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Removing blank lines

2007-03-13 Thread Grant
> > while( ) { > > push @out, $_ if /\S/; > > } snip > Is that better than: > > push @out, $_ unless /^\s*$/; snip They are functionally equivalent, but (at least on the version of perl I have) /\S/ is faster: Ok, I'll switch. Thanks. - Grant -

Re: Removing blank lines

2007-03-13 Thread Grant
at > way. This is an alternative to the [filter][/filter] method I had > been working on. Can anyone show me how to regexp the blank lines out > considering the above code? while( ) { push @out, $_ if /\S/; } Hi Rob, Is that better than: push @out, $_ unless /^\s*$/; - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Removing blank lines

2007-03-13 Thread Grant
, it completely fixed the problem. :) Thank you very much everyone. I will submit this to the interchange list for official inclusion in Interchange:Link. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Removing blank lines

2007-03-13 Thread Grant
k lines most efficiently that way. This is an alternative to the [filter][/filter] method I had been working on. Can anyone show me how to regexp the blank lines out considering the above code? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Removing blank lines

2007-03-12 Thread Grant
/ictag] [ictag][/ictag] If I use the filter like this: [filter no_white] [ictag][/ictag] [ictag][/ictag] [/filter] I get only one blank line, so it is an improvement. Should it be possible to remove the blank lines entirely? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additio

Re: Removing blank lines

2007-03-12 Thread Grant
any luck there either. I'm not sure what is actually creating the blank lines. It could be spaces, tabs, or some other blank line creator. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Removing blank lines

2007-03-12 Thread Grant
ine, consider a blank line. The works, but any whitespace will leave what appears to the eye as a blank line. Neither of these remove any of the blank lines in my HTML actually. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Removing blank lines

2007-03-12 Thread Grant
Hello, I'm having a lot of trouble figuring out how to remove blank lines from my HTML. The lines are generated by my shopping cart. I use (and highly recommend) interchange: http://www.icdevgroup.org I basically want to wrap all of my code in [filter no_blank_lines][/filter]. no_blank_lines

Fixing an apache2 perl module

2006-11-26 Thread Grant
ot;Doing redirect\n"; $r->content_type($set_content); close (SOCK)or die "close: $!\n"; return Apache2::Const::REDIRECT; } Please let me know if you can help. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands

Re: Syntax help with variable quotes

2006-07-31 Thread Grant
en "/path/to/the/$file.gif": $!); Yup it works great, I just wanted to check first. Thanks for the help. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: Syntax help with variable quotes

2006-07-31 Thread Grant
e > variable. I never know what to do with quotes in these situations. > Hope this is what you are searching for. $file="/path/to/the/file.gif"; open(LABEL,">$file"); I don't think so, unless I'm misreading your code. I want the .gif file to be named accor

Syntax help with variable quotes

2006-07-31 Thread Grant
quotes in these situations. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

CLOSED Re: Obtaining complete Unix command line that evoked script as string

2006-01-19 Thread Grant Jacobs
to the horse in which case you probably couldn't even lead a *sensible* horse to it :-) A smart horse might choose to be stubborn because it can see it doesn't make sense... -- --- Grant Jacobs Ph.D. BioinfoTools ph

CLOSED? Re: Obtaining complete Unix command line that evoked script as string

2006-01-14 Thread Grant Jacobs
4 AM -0500 13/1/06, zentara wrote: Try the news access to the maillist at nntp.perl.org Thanks for that, I'll keep it for the future. I started by looking at the list of lists on http://lists.cpan.org/, FWIW. Cheers, Grant Working solution (for now), if anyone cares for it. Details om

RE: CLOSING Re: Obtaining complete Unix command line that evoked script as string

2006-01-12 Thread Grant Jacobs
ly). It can be hard to make things clear via mail posts as you know. I'm used to helping the odd beginner myself, btw ;-) I only wrote on this list as there seemed to be no other "general" forum here; the others looked too specialised for this. Cheers, Grant -- ----

CLOSING Re: Obtaining complete Unix command line that evoked script as string

2006-01-12 Thread Grant Jacobs
e whole point of my previous post... ;-) (sigh) No offense, but I don't think you've really reading my posts. I use ARGV every day of course; it doesn't give the whole command *line*, only the argument list and also only after sh

*NOT* SOLVED Re: Obtaining complete Unix command line that evoked script as string

2006-01-11 Thread Grant Jacobs
imagine the shell splitting into the five piece, but it'd also mean that Unix::PID is very unlikely to be any use to me :-( (I know bash 3.0+ has a BASH_COMMAND env. var. and I'm looking into installing a bash 3.0.x alongside Apple's 2.05b btw, but it'd be nicer to have a so

SOLVED Re: Obtaining complete Unix command line that evoked script as string

2006-01-11 Thread Grant Jacobs
t'd also mean that Unix::PID is very unlikely to be any use to me :-( (I know bash 3.0+ has a BASH_COMMAND env. var. and I'm looking into installing a bash 3.0.x alongside Apple's 2.05b btw, but it'd be nicer to have a solution that's not tied to a particular shell or ver

Obtaining complete Unix command line that evoked script as string

2006-01-10 Thread Grant Jacobs
icularly easy way to make it trustworthy. In any event, its also plain ugly! Using bash's PROMPT_COMMAND to clear the value doesn't help, as this doesn't apply if the command lines are within a non-interactive script. Grant -- ---

Re: $variables in a string

2005-05-15 Thread Grant
x27; > > $image->Read(file=>\*IMAGE); > > close(IMAGE); > > # trouble > > $image->Resize(geometry=>'"$height"x"$width"'); > this should be written (geometry => "$heightx$width") > > > # trouble > > $image-&g

$variables in a string

2005-05-15 Thread Grant
ble open(IMAGE, 'Read(file=>\*IMAGE); close(IMAGE); # trouble $image->Resize(geometry=>'"$height"x"$width"'); # trouble $image->Write(filename=>'/var/www/localhost/htdocs/"$sku".jpg'); - Grant -- To unsubscribe, e-ma

Help with SOAP-Lite request in Perl

2005-05-02 Thread Grant
to deserialize. I'm using Perl from within Interchange: http://www.icdevgroup.org Does anyone know what that error means? Should I post my code? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

Re: arrays

2005-03-14 Thread Grant
best way to > > do that? Something like my badly formed example would be great. > > Here a possibility with a counter variable used in the key name: > > my $cnt=1; > foreach my $result (@{$results->{resultElements}}) { > $Scratch->{'google_results_title_

Re: arrays

2005-03-13 Thread Grant
> > Afterwards, you can access the titles with a lookup of the url. I will need to manipulate the data with Interchange conventions like: [tmp name="google_results_title_1"]value[/tmp] and [scratch name="google_results_title_1"] and to do that I will need the data i

Re: arrays

2005-03-13 Thread Grant
->{title}, $Scratch->{google_results_url_2} = $results->{resultElements}->[2]->{url}; but I need the right syntax. How would that go? If you're curious about scratch variables, it's an Interchange convention. http://www.icdevgroup.org - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

arrays

2005-03-13 Thread Grant
I've got an array returned from Google's API and I need to get the data out of it. The best I can do right now is: ARRAY(0x8262e088) Can anyone help me out? - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.per

Re: Perl print command from browser

2005-01-18 Thread Grant
gt; > > > > This last option sound like the way to go. Ok, thanks a lot. If that sounds like it should work then I'll set that up. > Just out of interest ... what sort of printer is it? It's a Zebra LP 2844 thermal label printer. - Grant > Daniel Kasak -- To unsubsc

Perl print command from browser

2005-01-18 Thread Grant
On Gentoo Linux I have a printer that doesn't have a Linux driver, but I know how it can be printed to within a perl environment. The labels to be printed are images viewed within a web browser (firefox), and firefox lets you specify the exact command that prints. I'm not too familiar with p

Re: can we embedd perl script and Html, like we r doing in php

2004-11-02 Thread Grant
and Geeklog doing similar things. > > Interchange, which doesn't appear to use any of the standard template > modules, and so presumably has custom code for this, is more similar to > these kinds of high level applications, rather than development toolkits > like the others li

Re: can we embedd perl script and Html, like we r doing in php

2004-11-02 Thread Grant
HP does. > > There are others, but these are the most commonly used ones. > > -- > Chris Devers I use Interchange http://www.icdevgroup.org which sounds a lot like this. It's an incredible system, but a little tough to learn. - Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

CPAN failure

2004-09-16 Thread Grant
ake test -- NOT OK Running make install make test had returned bad status, won't install without force and it stops. I think this is happening while trying to install SOAP-Lite or URI (which is one of its dependencies). Does anyone have any advice for me? - Grant -- To unsubscribe, e-ma

how to pass a list to a subroutine?

2002-10-05 Thread Grant Byers
Is there a simple way to unflatten @_ into a list within a subroutine? ie: sub mySub(%); mySub(arg1=>'val1',arg2=>'val2',arg3=>'val3') now i want to expand @_ back into a list. Cheers, Grant -- To unsubscribe, e-mail: [EMAIL PROTECTED]

Quick ?

2002-09-27 Thread Grant Hansen
What is the ! doing in this statement? $quit = 0; while (! $quit) Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

State Variables

2002-09-27 Thread Grant Hansen
Can anyone provide an example of how to use a state variable to break out of a loop? Thanks -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Help on Arrays - Beginner

2002-09-20 Thread Grant Hansen
y for further processing that I am confused on. Thanks On Friday 20 September 2002 08:06 pm, Timothy Johnson wrote: > I'll give you a hint. This is perfectly legal: > > my @array = ; > > Let me know if you still can't figure it out. > > -Original Message-

Help on Arrays - Beginner

2002-09-20 Thread Grant Hansen
, and reading it to , modifying each line, sort and then print. Here is the Input: Grant Hansen Dave Thomas Roger Starbauch Here is the intended output: Hansen, Grant Starbauch, Roger Thomas, Dave Here is my code: while() { chomp(@lines = split); @lines1 = $lines[1] . ", " .

Write statement ?

2002-03-01 Thread Grant $ Sandra Hansen
The problem lies in the second loop. Each time through the loop I am writing to a separate file, which appears to be working, the body of the report is in each file. The header is what I am having problems with. I want to change the page length so the header appears at the top of each file inste

RE: Looping Code ?

2002-02-28 Thread Grant Hansen
Here is the entire code: What I am trying to do is change the default page length in format from 60 to what ever the page length is for the data I am reading. This way the header will print at the top of each file instead of at the beginning of each 60 line page, which is what it is currently do

RE: Uninitialized Value Error

2002-02-25 Thread Grant $ Sandra Hansen
Thanks for all your help, I got working. Thanks again. -Original Message- From: Luke Bakken [mailto:[EMAIL PROTECTED]] Sent: Monday, February 25, 2002 6:11 PM To: Lyon, Justin Cc: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'; [EMAIL PROTECTED] Subject: RE: Uninitialized Value Error use str

RE: Cleanest way to split this

2001-07-25 Thread Grant McLean
r example) As a matter of interest, it also assume that the quoted fields do not have embedded newlines. It is perfectly possible for CSV files generated by Excel to contain embedded newlines, and DBI::CSV (via Text::CSV_XS) handles this admirably Regards Grant -- To unsubscribe, e-mail: [EMAIL

HELP!!! What's wrong with my app.??

2001-07-19 Thread Jon Grant
Hi all, I am a perl beginner and find myself somewhat stuck, please help!! I am trying to write a program that will access a log file that has a list of resource addresses. The program will then create an html page that returns the last address from the log file as a link in an html page. I atta

RE: Reference found where even-sized list expected

2001-07-03 Thread Grant McLean
# also fine Which may or may not have helped :-) Regards Grant ===== Grant McLean | email: [EMAIL PROTECTED] | Lvl 6, BP House The Web Limited| WWW: www.web.co.nz| 20 Customhouse Quay Internet Solutions | Tel:

RE: Re[5]: Best practice for config file use?

2001-06-28 Thread Grant McLean
From: Tim Musson [mailto:[EMAIL PROTECTED]] > I like this option the best of the 3, but it is still hard to give to > a non programing person and not expect them to mess up setting the > vars... > > ie, => is what you separate things with, explaining which ' to > use (' not `), end each parameter

  1   2   >