Re: solved - controlling Firefox using Perl

2021-03-15 Thread Gary Stainburn
On 12/03/2021 13:34, Gary Stainburn wrote: Can anyone please point me to decent documentation for controlling Firefox using perl? I am open to any solution, but I have already looked at both Selenium::Firefox, and Selenium::Remote::Driver. I have Selenium::Firefox working on a Centos 7 box

Re: controlling Firefox using Perl

2021-03-12 Thread Gary Stainburn
On 12/03/2021 15:52, Dermot wrote: In the past I have opted to use Webdriver::Tiny. However I've only ever used it with Chromium browser but the documentation says it can work with Geckodriver. The API for Webdriver::Tiny is slightly different from Selenium::Firefox

controlling Firefox using Perl

2021-03-12 Thread Gary Stainburn
Can anyone please point me to decent documentation for controlling Firefox using perl? I am open to any solution, but I have already looked at both Selenium::Firefox, and Selenium::Remote::Driver. I have Selenium::Firefox working on a Centos 7 box, but I can't find any documentation on how t

use string in "use"

2020-12-14 Thread Gary Stainburn
I've written my first re-usable modules in Perl, and all goes well. However, I want to know if / how I can use a string variable in the 'use' clause. In PHP I have a simple system of turning on/off debugging and version control.  Any file *1.html is development version.  I then have $DEBUG=(

Re: regex help - only one value returned

2020-12-02 Thread Gary Stainburn
On 02/12/2020 13:56, Vlado Keselj wrote: Well, it seems that the first one is what you want, but you just need to use $1 and ignore $2. You do need parentheses in '(mr|mrs|miss|dr|prof|sir)' but if you do not want for them to be captured in $2, you can use: '(?:mr|mrs|miss|dr|prof|sir)'. For ex

regex help - only one value returned

2020-12-02 Thread Gary Stainburn
I have an array of regex expressions that I apply to text returned from tesseract. Each match that I get then gets stored for future processing. However, I'm struggling with one regex. The problem is that: 1) with brackets round the titles it returns two matches. 2) without brackets, it retu

Re: CPAN not working, or is it?

2019-03-12 Thread Gary Stainburn
On Tuesday 12 March 2019 06:16:59 Magnus Woldrich wrote: > $ perl -E 'say for @INC' > $ echo $PERL5LIB > # echo $PERL5LIB > > I'd suggest to set the PERL5LIB environment variable in your shell > config to something like ~/lib/perl5/. > > If you need the modules to be available globally and not o

CPAN not working, or is it?

2019-03-11 Thread Gary Stainburn
I'm replacing a dead F19 box with a new C7 one and I'm trying to get my Perl install completed. Ultimately, I need to get Selenium::Remote::Driver working, but I'm struggling before that. I started off as always by using RPM's for everything I possibly can. I then started to use CPAN for every

Replacing 10 year old web server

2018-06-29 Thread Gary Stainburn
I'm replacing my old F9 web server with a new C7 one. While I've used RPM's for most packages there have been times when I've had to use CPAN and PEAR. For the PEAR items I'm able to do pear list -a > pear_list.txt to get a list of all modules installed that way. Is there an equivelent comma

Re: can not locate installe module

2018-06-04 Thread Gary Stainburn
On Monday 04 June 2018 10:39:28 Shlomi Fish wrote: > is there anything in https://en.wikipedia.org/wiki/Environment_variable ? I do have some interesting perl settings, although I have no idea where they have come from. This is a brand new Centos 7 install, and prior to trying to install the th

Re: can not locate installe module

2018-06-04 Thread Gary Stainburn
On Monday 04 June 2018 09:36:02 Shlomi Fish wrote: > what does "perldoc -l MIME::Parser" say? Also see > http://perl-begin.org/FAQs/ and http://perl-begin.org/topics/cpan/ . I have tried this for all three modules installed through CPAN and all three come up with the same thing: [root@ollie2 ~]#

can not locate installe module

2018-06-04 Thread Gary Stainburn
I've juts built a new Centos 7 email server and all has gone well. I have used RPM's where possible, but for some modules I have had to use CPAN. One such module was MIME::Parser, which installed without errors. If I check my program it now says that it's fine. If I try to re-install the modu

Re: regex with HEX ascii chars

2018-04-13 Thread Gary Stainburn
On Thursday 12 April 2018 19:53:16 Shlomi Fish wrote: > Perhaps see http://perldoc.perl.org/perlunitut.html - you may need to read > the file as binary or iso8859-1 or whatever. Also see Thanks for this Shlomi. I have looked into that before briefly when doing http gets and reading office documen

regex with HEX ascii chars

2018-04-12 Thread Gary Stainburn
I have a text file (created by pdftotext) that I've imported into my script. It contains ASCII characters 251 for crosses and 252 for ticks. If I load the file in gvim and do :as it reports the characters as 251, Hex 00fb, Octal 373 252, hex 00fc, Octal 374 However, when I try to seacch f

Re: Getting the results of a remote script

2017-11-10 Thread Gary Stainburn
Hi Shlomi, On Friday 10 November 2017 11:52:12 Shlomi Fish wrote: > > While I agree, see http://seriot.ch/parsing_json.php for a roundup of > security problems and inconsistencies in JSON parsers. Thanks for this, I'll give it a look when I get the chance. Thankfully, so far I haven't seen any p

Re: Getting the results of a remote script

2017-11-10 Thread Gary Stainburn
On Friday 10 November 2017 00:08:09 SSC_perl wrote: > > On Nov 9, 2017, at 2:06 PM, David Precious wrote: > > > > you'll get whatever the script output to STDOUT. > > Thanks a million, Dave! STDOUT was what I was missing. I've never used > that before, so this was news to me. The remote s

Re: "Information station" using Perl and Raspberry Pi

2017-07-27 Thread Gary Stainburn
(resent as it never appeared) I have seen a few projects similar to the one you've linked. This is the first one using a Pi Zero that I've seen but there's no reason why this wouldn't work. (I've never used Pi Zero's personally) A RPi2 and 3 both have 4 USB ports, LAN, HDMI, and audio out. His

Re: "Information station" using Perl and Raspberry Pi

2017-07-26 Thread Gary Stainburn
I have seen a few projects similar to the one you've linked. This is the first one using a Pi Zero that I've seen but there's no reason why this wouldn't work. (I've never used Pi Zero's personally) A RPi2 and 3 both have 4 USB ports, LAN, HDMI, and audio out. His point about a Pi2 and a smalle

Re: Mail::Sender and Precedence: bulk [solved]

2017-04-21 Thread Gary Stainburn
am it worked fine. By fixing the syntax errors the original program now also works. Gary On Friday 21 April 2017 09:46:07 Gary Stainburn wrote: > This is the constructor I (almost) always use when using Mail::Sender. > > my $sender=new Mail::Sender {from=>'we

Mail::Sender and Precedence: bulk

2017-04-21 Thread Gary Stainburn
This is the constructor I (almost) always use when using Mail::Sender. my $sender=new Mail::Sender {from=>'webmas...@ringways.co.uk', reply=>'webmas...@ringways.co.uk', headers=>'Precedence: bulk', smtp=>'mail.ringways.co.uk', fake_from=>'Webmast

Re: event driven daemon

2016-12-22 Thread Gary Stainburn
een the requester and > the worker. > One of my favorite, simple approaches is to put files into a directory. > Each file represents a tasks and perhaps contains interesting metadata. > > chris > > On Wed, Nov 23, 2016 at 7:36 AM, Gary Stainburn < > > gary.stainb...@ringways.c

Re: event driven daemon

2016-11-23 Thread Gary Stainburn
On Wednesday 23 November 2016 14:05:40 Shlomi Fish wrote: > Aside from named pipes there are also unix-domain sockets and TCP sockets, > both of which are more robust. The closest thing I've got to IPC is writing an xinetd service, which I then called from perl scripts using Net::Telnet. IPC is

event driven daemon

2016-11-22 Thread Gary Stainburn
This is a request for opinions rather than an answer to a problem. I'm looking to write a daemon that can sit on my Domoticz (home automation) server and can respond to Domoticz events and can receive commands to run tasks that would otherwise block the server. These will include things like 1

Re: virus detection - empty DOC or XLS with a macro

2015-10-20 Thread Gary Stainburn
I still haven't worked out how to check for macros yet but the text has been sorted #!/usr/bin/perl use strict; use warnings; use Text::Extract::Word; use Spreadsheet::ParseExcel; use Spreadsheet::ParseXLSX; use File::Basename; if (!$ARGV[0]) { die "Usage: $0 "; } if (! -r $ARGV[0]) { die

Re: virus detection - empty DOC or XLS with a macro

2015-10-20 Thread Gary Stainburn
to check. > > regards. > > On 2015/10/19 星期一 18:35, Gary Stainburn wrote: > > Is there any way within Perl to examine DOC and XLS files to > > > > 1) see if the document is empty, i.e. no text and no cell contents > > 2) has Macros embedded > > > >

virus detection - empty DOC or XLS with a macro

2015-10-19 Thread Gary Stainburn
Is there any way within Perl to examine DOC and XLS files to 1) see if the document is empty, i.e. no text and no cell contents 2) has Macros embedded We're getting lots of virus emails claiming to be invoices, receipts, etc. with documents that match the above criteria which actually contain a

Re: access hash in specific sequence

2015-09-04 Thread Gary Stainburn
On Thursday 03 September 2015 21:50:54 Marius Gavrilescu wrote: > gary.stainb...@ringways.co.uk (Gary Stainburn) writes: > > On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote: > >> The above can be shortened using the Sort::Key module. > >> >

Re: access hash in specific sequence

2015-09-03 Thread Gary Stainburn
On Thursday 03 September 2015 18:19:57 Marius Gavrilescu wrote: > gary.stainb...@ringways.co.uk (Gary Stainburn) writes: > > I am aware that you cannot define a key sequence when defining a hash. > > However, if I create a sequence field > > > > my %pagetypes=( > >

access hash in specific sequence

2015-09-03 Thread Gary Stainburn
I have a hash of hashes which I converted to an array of hashes because I needed to access them in a specific sequence. It now looks like my @pagetypes=( {'pagetype'=>'Delivery Note','weight'=>2,. {'pagetype'=>'Sales Invoice','weight'=>2,. {'pagetype'=>'Purchase

Best way to translate parts of strings

2015-07-24 Thread Gary Stainburn
Hi I'm still extracting text from OCR generated documents. I've managed to extract likely fields for registration numbers, stock numbers and VINs. Unfortunately some strings have a 'S' instead of a 5 or a 'B' instead of a 8 The fields are of the format RegistrationXX99XXX Stock no

Re: script to parse OCR output different between servers

2015-07-22 Thread Gary Stainburn
All I can say is,, I've not had a good day. This is the correct code for getting the most popular value. I'd forgot to update $count with $value foreach my $field (keys %found) { # foreach field my $value=''; my $count=0; foreach my $key (keys %{$found{$field}}) { # foreach field -> value

Re: script to parse OCR output different between servers

2015-07-22 Thread Gary Stainburn
Below is my revised code based on your comments. It is tidier but more importantly it works correctly. Ironically, it didn't actually work correctly before on my dev machine either,– it didn't find all matches. It looks like using my original code it was only using the first element in each

Re: script to parse OCR output different between servers

2015-07-22 Thread Gary Stainburn
On Wednesday 22 July 2015 16:10:18 Shlomi Fish wrote: > Hi Gary, > > some comments about your code. > > On Wed, 22 Jul 2015 15:32:33 +0100 > > Gary Stainburn wrote: > > I've written the code below to parse a number of text page files > > generated by Tesserac

script to parse OCR output different between servers

2015-07-22 Thread Gary Stainburn
I've written the code below to parse a number of text page files generated by Tesseract OCR software to look for a guess the most likely values for VIN, Reg number and stock number for a vehicle. On my development site it works fine and gives the values it should. However, on my live server it o

Re: Can u suggest me the best ide for perl

2015-03-16 Thread Gary Stainburn
On Friday 13 March 2015 17:32:50 Bob goolsby wrote: > The best IDE that I know of is a properly customized VIM. That's interesting. How would define customised? I exclusively use (g)vim for editing and have a number of key bindings etc. that help in my style of working, but would still not consi

simple module install via CPAN not working.

2015-02-16 Thread Gary Stainburn
I'm still looking to get WWW::Mechanize::Firefox installed. It looks like I've got a more pressing issue. Even simple module installs aren't working properly. I'm working through the dependancy list and looking at Test::Tester and Test::NoWarnings. Installing Test::Tester worked fine, but when

Yum / CPAN install problems - WWW::Mechanize::Firefox

2015-02-16 Thread Gary Stainburn
I've got a Fedora 21 laptop that I'm using to develop a WWW::Mechanize::Firefox based app which is going well. I've tried now to replicate this on two servers ready to put it live but I'm having the same install problems. One is F19, and one is F20. On both machines I've done yum install pe

WWW::Mechanize::Firefox not waiting for page loaded

2015-02-10 Thread Gary Stainburn
Hi folks, I'm porting a WWW::Mechanize based program to WWW::Mechanize::Firefox because the web site I access is now much more Javascript based and maintenance is getting to be a nightmare. However, I'm struggling on the basics. Yesterday I started off with a very basic program. I wrote this

Suggestions - printing to ZEBRA credit card printer attached to Win7 PC

2014-09-16 Thread Gary Stainburn
what other options are available for producing the document suitable for sending to the printer. Going back 20 years to when I used to write in Borland Delphi there was a component for creating printer documents and adding contents. Are there similar PERL modules? What are people's prefer

Re: async, non blocking tcp server

2014-08-29 Thread Gary Stainburn
On Friday 29 August 2014 10:33:12 Chris Knipe wrote: > Unfortunately not (we are talking NNTP specifically here if it isn't > obvious yet) - and the data rates on the network in terms of the > stream we're looking at over 1Gbps (generated with the TAKETHIS > commands). The other seemingly obvious

Re: Help with a RE

2014-01-09 Thread Gary Stainburn
On Thursday 09 January 2014 09:53:35 Gary Stainburn wrote: > On Thursday 09 January 2014 02:01:55 timothy adigun wrote: > > Hi, > > > > On Thu, Jan 9, 2014 at 11:57 AM, Peter Gordon > > wrote: > > > I'm trying do write a one line RE to strip sequence number

Re: Help with a RE

2014-01-09 Thread Gary Stainburn
0-9_-]+//; Shouldn't that be s/^[0-9]+[-_]// -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Tips or Tricks to print out tab-separated data?

2013-06-21 Thread Gary Stainburn
On Friday 21 June 2013 14:04:33 John W. Krahn wrote: > print join( "\t", @array ), "\n"; Marc The reason that John's code works and yours doesn't is that with John's code the join function only includes the @array which is what I'm guessing you meant. What your code did was to tag the "\n" on

Spreadsheet::WriteExcel - multi-coloured text in cells

2013-05-15 Thread Gary Stainburn
Hi folks Is it possible to write text cells where part of the string is highlighted in red? If so, how can I do it? Gary -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: ISO decoding

2012-11-06 Thread Gary Stainburn
On Tuesday 06 November 2012 12:25:27 Shlomi Fish wrote: > > Please see: > > https://metacpan.org/module/MIME::Words > > Regards, > > Shlomi Fish > Worked a treat. Thanks -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk -- To uns

ISO decoding

2012-11-06 Thread Gary Stainburn
859-1?B?UmluZ3dheXMgRG9uY2FzdGVy?= =?ISO-8859-1?B?IEtpYSBTaG93cm9vbQ==?=" '; $from=decode('iso-8859-1',$from); print "from='$from'\n"; but the string doesn't get decoded. -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.

Re: SOLVED: inetd vs console calling a script

2012-10-12 Thread Gary Stainburn
On Thursday 11 October 2012 20:53:08 Andy Bach wrote: > On Thu, Oct 11, 2012 at 4:36 AM, Gary Stainburn > > wrote: > >> Is there a quick and easy way to detect which method called it? > > > > my $xinetd=(defined $ENV{REMOTE_HOST}); > > MIght be intere

SOLVED: inetd vs console calling a script

2012-10-11 Thread Gary Stainburn
On Thursday 11 October 2012 10:22:04 Gary Stainburn wrote: > Hi folks. > > I've got a server script that I call via xinetd. I occasionally call it > from the command line too, but now want it to handle the interactions > differently depending on how it's called. > >

inetd vs console calling a script

2012-10-11 Thread Gary Stainburn
Hi folks. I've got a server script that I call via xinetd. I occasionally call it from the command line too, but now want it to handle the interactions differently depending on how it's called. Is there a quick and easy way to detect which method called it? Gary -- Gary Stainburn

Re: Win32::Watir on strawberry Perl

2012-09-04 Thread Gary Stainburn
example now works great. Does anyone know of more useful examples of using Watir? -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Win32::Watir on strawberry Perl

2012-09-04 Thread Gary Stainburn
riteables.tar.gz Running make install Appending installation info to C:\strawberry\perl\lib/perllocal.pod SHIMI/Win32-Watir-0.06-withoutworldwriteables.tar.gz C:\strawberry\c\bin\dmake.EXE install UNINST=1 -- OK cpan> -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Win32::Watir on strawberry Perl

2012-09-04 Thread Gary Stainburn
bless (\%opts, $class); $self->_check_os_name();# line 106 if ( $opts{'ie'} or $opts{'find'} ){ return $self->_startCustomIE(); } else { return $self->_startIE(); } } -- Gary Stainburn Group I.T. Manager Ringways Garages http

SOLVED Re: Regex sending me mad

2012-07-27 Thread Gary Stainburn
nce the over the top spec. The problem eventually turned out to be that the "space" between the make and model wasn't actually a space, i.e. wasn't ASCII 32. I have now got the people generating the data to generate it correctly and all is now fine, with a much simpler reg

Regex sending me mad

2012-07-27 Thread Gary Stainburn
a' About to split 'Kia Venga' I have a test script which works fine. Can anyone see what I'm doing wrong? #!/usr/bin/perl -w use warnings; use strict; my $t='Kia Venga'; if ($t=~/ *?(\w*) (.*?) *$/) { print "1='$1' 2='$2'\n"; } [root

Re: & and subroutine

2012-04-17 Thread Gary Stainburn
On Tuesday 17 April 2012 15:13:40 Manfred Lotz wrote: > You have > sub mysub() { > > instead of > > sub mysub { > > which is the correct way. Thank you. I can't believe how many years I've been getting that one wrong. Gary -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: & and subroutine

2012-04-17 Thread Gary Stainburn
meaning. Gary [root@stan ~]# cat t.pl #!/usr/bin/perl -w use strict; use warnings; mysub(); sub mysub() { print "hello world\n"; } [root@stan ~]# ./t.pl main::mysub() called too early to check prototype at ./t.pl line 7. hello world } > > -- > Manfred -- Gary Stainburn Group I.T. Manager Ringways Garages http://www.ringways.co.uk -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: & and subroutine

2012-04-17 Thread Gary Stainburn
> > It's good practice not to use it unless you understand exactly why you > would need to use it. Could someone please expand on this as I seem to always have to do this. If I 'use strict' and 'use warnings' I get errors if I don't. -- Gary Stain

Re: WWW::Selenium click not working - CPAN install problem

2012-04-05 Thread Gary Stainburn
results for installing this module, try: reports LUKEC/Test-WWW-Selenium-1.32.tar.gz Running make install make test had returned bad status, won't install without force Failed during this command: LUKEC/Test-WWW-Selenium-1.32.tar.gz : make_test NO cpan[2]> On Thursday 05 Ap

WWW::Selenium click not working

2012-04-05 Thread Gary Stainburn
Hi folks. Returning to Perl on Win32 for the first time in ages. Installed Strawberry Perl and WWW::Selenium. However, when I run the example in the CPAN help page, it hangs because the $sel->click doesn't work. If I manually click on the button the rest of the script works fine. Anyone got a

Re: SOLVED - Re: perl and pipes - reading from syslog-ng

2010-12-15 Thread Gary Stainburn
27;ve read the page, and changed my code accordingly. Thank you. > Regards, > > Shlomi Fish > > > and now it works perfectly. -- Gary Stainburn I.T. Manager Ringways Garages http://www.ringways.co.uk -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

SOLVED - Re: perl and pipes - reading from syslog-ng

2010-12-15 Thread Gary Stainburn
Isn't it typical. Been working on this since yesterday, but as soon as I post the question I find the answer· I've changed foreach my $line () { to while () { my $line=$_; and now it works perfectly. On Wednesday 15 December 2010 11:19:07 Gary Stainburn wrote: > Hi fo

perl and pipes - reading from syslog-ng

2010-12-15 Thread Gary Stainburn
I see the output as it is being generated. The program works perfectly fine if I redirect STDIN from an old log file, but if I run it as either firewall_monitor ) { my $wline=$line; print "$line\n"; } # while STDIN -- Gary Stainburn I.T. Manager Ringways Garages http://www.rin

Passing a REGEX as an argument to a sub

2010-11-22 Thread Gary Stainburn
m accessing I'm having to do a lot of manual HTML parsing. The code is: foreach (split(/\n/,$html)) { if (/HREF="(.*)".*SomeDisplayText/) { $URL=$1; last; } Is there a way I can change this to a sub and pass the HTML string and the regex as arguments? Thanks -- Gary

Solved: First LWP::UserAgent and HTML::Form app.

2010-03-30 Thread Gary Stainburn
Sod's law folks. Posted the question then reviewed what I'd done and found the problem. Mixing three examples gave me the wrong code. Lifted the line straight from the HTML::Form perldoc and it worked. $req=$ua->request($form->click); Gary On Tuesday 30 March 2010 09:41:5

First LWP::UserAgent and HTML::Form app.

2010-03-30 Thread Gary Stainburn
type='text' name='usersid' value='' type='password' name='pw' value='' type='submit' name='submit' value='Continue' type='hidden' name='fromHome' value='true' action=http://te

Re: How to read email from Inbox

2008-12-23 Thread Gary Stainburn
a > This is not something I've done but I know there are lots of CPAN modules for doing this. Go to http://search.cpan.org/search?query=mail+web&mode=all and the first suggestion I got was Mail::Webmail::GMail For traditional mail server setups try searching for POP3 or IMAP -- G

Re: grabbing text between two tokens

2008-04-14 Thread Gary Stainburn
r =~ m/tokena(.*?)tokenb/ms; The ? after the * stops it being greedy - i.e. it stops at the 1st tokenb and not the last Gary -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclos

Re: [OT] Warnings from code when using perl-dbi

2007-08-16 Thread Gary Stainburn
} else { print "\"$field\""; } if (@row) # fields left, stick in a comma { print ","; } } print ("\n"); } -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by intere

RT3 re-install, DBI login problem.

2007-08-09 Thread Gary Stainburn
Set($DatabasePassword , ''); Set($DatabaseName , 'rt3'); *** listing 4 [Thu Aug 09 09:10:59 2007] [error] [client 10.2.1.3] Connect Failed FATAL: password authentication failed for user "rt_user"\n\n at /opt/rt3/lib/RT.pm line 205\n -- Gary Stainburn This emai

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Gary Stainburn
. If it fails it returns false and the loop exits. Loosely speaking anyway Gary > > -Original Message- [snip] > Hi Ayesha > > you need to only read once per line, but remember the last one. > > $prev= > while ($this=) { > print "$prev and $this\n"; >

Re: Extreme beginner question on reading lines from a file.

2007-07-18 Thread Gary Stainburn
> > Any suggestions here will be very helpful > > thanks > Ayesha Hi Ayesha you need to only read once per line, but remember the last one. $prev= while ($this=) { print "$prev and $this\n"; $prev=$this; } Gary -- Gary Stainburn This email does not contain private or

Re: Dynamically loading perl code

2007-07-12 Thread Gary Stainburn
ou thinking about the eval function. perldoc -f eval Gary -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 -- T

Re: TWO loops and ONE

2007-07-03 Thread Gary Stainburn
line 11 again. Work out what values $j and $j+1 will have as you go through the two loop2. If you get an uninitialized value error on an array it usually means you've shot off the end of it. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped o

Re: Fwd: TWO loops and ONE if statement

2007-07-03 Thread Gary Stainburn
ue, look at how you are indexing the array - specifically on line 11. If necessary, walk through the program with pen and paper. The mistake you've made is a common one Gary (BTW, please keep things on-list so others can share/help) -- Gary Stainburn This email does not contain priva

Re: Fwd: TWO loops and ONE if statement

2007-07-03 Thread Gary Stainburn
hen you don't use it, so you don't need it anyway. (Hint, re-think about the array index ranges you're looking at) -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purp

SOLVED - Re: Tie::Handle::CSV

2007-06-28 Thread Gary Stainburn
) > -|| croak $opts->{'csv_parser'}->error_input(); > +|| croak "could not parse: [" . > $opts->{'csv_parser'}->error_input() . "]"; > if ( $opts->{'header'} ) > { >

Re: Tie::Handle::CSV

2007-06-27 Thread Gary Stainburn
odule and I can't see any reference to why it should do this, or how to stop it. -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers

Tie::Handle::CSV

2007-06-27 Thread Gary Stainburn
print "Estimate Sent:\t",$csv_line->{"Estimate Sent"}, "\t"; print "Authorised:\t",$csv_line->{"Authorised"}, "\t"; print "Repaired:\t",$csv_line->{"Repaired"}, "\n"; print "Manufacturers Ref.:

CPAN problem - Test::WWW::Mechanize

2007-05-09 Thread Gary Stainburn
2 22.22% 5 9 t/link_status.t 83 37.50% 4 6 8 t/links_ok.t 84 50.00% 4-7 t/page_links_content.t92 22.22% 5 9 t/page_links_ok.t 52 40.00% 4-5 2 tests skipped. Failed 7/17 test scripts, 58.82% okay.

Re: first Perl application

2006-09-11 Thread Gary Stainburn
reading the file directly, and parsing the contents. I've got a basic script that I use to read .xml files written by MS Excel, as I find that's the easiest way to import multi-sheel Excel spreadsheets. Gary -- Gary Stainburn This email does not contain private or confidential mat

Re: XML::Simple help request

2006-08-22 Thread Gary Stainburn
> -- > Owen print "cn='".$VAR1->{'cn'}."'\n"; print "email='".$VAR1->{'address-list'}[0]->{'address'}[0]->{'email'}."'\n"; Work your way down the list counting curly and s

solved - Re: POD rendering - was Re: POD: force line break?

2006-08-08 Thread Gary Stainburn
On Tuesday 08 August 2006 12:16, Mumia W. wrote: > On 08/08/2006 04:19 AM, Gary Stainburn wrote: > > [ snipped ] > > What's the best way to force the formatting similar to the original > > layout? > > Did you read the perlpod document (perldoc perlpod)? yes >

POD rendering - was Re: POD: force line break?

2006-08-08 Thread Gary Stainburn
similar to the original layout? -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000 -- To unsubscribe, e-mail: [EMAIL PROTECTED]

using MS Excel generated .xml files

2006-06-30 Thread Gary Stainburn
Would anyone like to pass on any experiences / recommendations before I dive headlong in. Ta Gary -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investig

Re: uninitialized value error

2006-06-21 Thread Gary Stainburn
e 71? Is it something like $var1=$var2; or if ($var2 == 'fred') { If so, you're trying to read a value from $var2 before you've written a value to it, hence the warning message given. -- Gary Stainburn This email does not contain private or confidential material as it may

Re: 15 Million RAW

2005-11-25 Thread Gary Stainburn
t; starved there and software optimizations seem like they might not be > enough. But until you've figured out where the time is being spent, > or what system resource is being exhausted, you can't properly > address the problem. > > Really, you could do a whole lot worse t

call ext prog - best way

2005-11-24 Thread Gary Stainburn
0] || die "$0: cannot chdir: $!\n"; foreach my $engine (%engines) { my @output=qx{$engine->{'cmd'} .}; # check for result code to indicate success/failure/virus found etc # if virus, return lines reporting it from @output # use map/grep/whatever to extract line

Re: regex search/replace syntax

2005-11-04 Thread Gary Stainburn
On Friday 04 November 2005 12:20 pm, Xavier Noria wrote: > On Nov 4, 2005, at 13:03, Gary Stainburn wrote: > > Hi folks I've got the following code which generates > > > > Parse error: parse error in /home/httpd/html/consumables.html on > > line 290 > > > &

regex search/replace syntax

2005-11-04 Thread Gary Stainburn
vision by zero in /home/httpd/html/consumables.html on line 290 which for some reason it displays twice. Anyone got any ideas? -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undiscl

Re: regex search/replace syntax

2005-11-04 Thread Gary Stainburn
On Friday 04 November 2005 12:03 pm, Gary Stainburn wrote: [snip] > $orderSQL is a string containing a number of SQL statements with the > placeholder &total; and $or_total has a value of '695.76' > Sorry, the placeholder is TOTAL not &total. I changed it to see if i

Re: What am I doing wrong?

2005-11-04 Thread Gary Stainburn
would be very much appreciated > > thanks, jean > Hi Jean I'm struggling to see what you're trying to do. Could you give me an examle of the schema/data you're working from. I'd like to have a go at rewriting this one to see how well I do. Gary -- Gary Stainburn

Re: What am I doing wrong?

2005-11-04 Thread Gary Stainburn
ty[$i]\n"; > } > else { >***print "$sku[$i-1]",', totaalaantal is ', >"$t_qty[$i-1]\n"; > } > } > } >

Re: IP address and Browser version.

2004-11-20 Thread Gary Stainburn
if (!$VALUE); print " $KEY $VALUE "; } print " "; chomp(@SETS = qx!/bin/bash -c set!); for(@SETS) { print "$_\n"; } print " "; # Print statement (and program) ends here -- Gary Stainburn This email do

Re: Append on top

2004-11-15 Thread Gary Stainburn
se, as I said in my OP there may be reasons why you can't create a new file and have to do the update in place. Tie::File, like the other methods creates a new file and then copies that over the original. Gary -- Gary Stainburn This email does not contain private or confidential mater

Re: Append on top

2004-11-15 Thread Gary Stainburn
On Monday 15 November 2004 1:25 pm, Gary Stainburn wrote: [snip] > > calculate write_size > seek EOF-buffer_size > read buffer_size > seek EOF-buffer_size+write_size > repeat until at BOF > Oops, missed out the final lines of code, which are: seek BOF write new data bit of

Re: Append on top

2004-11-15 Thread Gary Stainburn
lly coding this into perl should be fairly easy, and could even be used to insert data mid-file if required. However, if this is something that you're going to be doing regularly, I'd suggest re-evaluating the data format, such as using a database. -- Gary Stainburn This email does

Re: Append on top (easy sollution)

2004-11-15 Thread Gary Stainburn
bb c d See? > --K-sPecial > > [ http://xzziroz.freeshell.org >irc://xzziroz.dtdns.net ] -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation

Re: Creating Microsoft Word Document with Perl

2004-11-02 Thread Gary Stainburn
a mailmerge/datasource and using Word to do the mailmerge took too long!!!) -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown and undisclosed purposes - Regulation of Investigatory Powers Act, 2000

Re: qx{} and ping problem.

2004-09-09 Thread Gary Stainburn
On Thursday 09 Sep 2004 12:20 pm, Flemming Greve Skovengaard wrote: [snip] > > Don't you mean 'ping -n -c 50 10.1.1.31' instead of 'ping -n 50 > 10.1.1.31'. Else read the man page for ping. Thanks for that, missed the obvious. -- Gary Stainburn This

qx{} and ping problem.

2004-09-09 Thread Gary Stainburn
e in concatenation (.) at ./pingcheck line 7. Use of uninitialized value in pattern match (m//) at ./pingcheck line 8. ^C [EMAIL PROTECTED] gary]$ -- Gary Stainburn This email does not contain private or confidential material as it may be snooped on by interested government parties for unknown

  1   2   3   4   >