Finding comment tags

2005-05-12 Thread Johnstone, Colin
Gidday all, How can I parse HTML to find comment tags Specifically.

RE: Wide character in print?

2005-04-05 Thread Johnstone, Colin
PROTECTED] Sent: Wednesday, 6 April 2005 12:17 PM To: Perl Beginners Subject: Re: Wide character in print? Johnstone, Colin wrote: > Gidday all, Hello, > What does this error mean please? ?? I assume that you mean the Subject line? perldoc perldiag [snip] Wide character

Wide character in print?

2005-04-05 Thread Johnstone, Colin
Gidday all, What does this error mean please? ** Colin Johnstone Independent Interwoven Teamsite Analyst Programmer (Contractor) eGovernment Delivery Team Department of Employment and Training Phone (07) 3244 6268 Fax (07) 3244 6265 Email Colin.

First time parsing XML

2005-04-01 Thread Johnstone, Colin
Gidday All, I would like to use xml Parser to parse this chunk of xml (below) and return the business unit name and id attributes for each of the elements where division id = '221' I have tried #!/web/Interwoven/TeamSite/iw-perl/bin/iwperl use XML::XPath; use XML::XPath::XMLParser; my $xpath;

First time Parsing XML

2005-04-01 Thread Johnstone, Colin
Gidday All, I would like to use xml Parser to parse this chunk of xml (below) and return the business unit name and id attributes for each of the elements where division id = '221' I have tried #!/web/Interwoven/TeamSite/iw-perl/bin/iwperl use XML::XPath; use XML::XPath::XMLParser; my $xpath;

Using cgi.pm for checkbox goups

2004-11-15 Thread Johnstone, Colin
Gidday all, I have created a form with a group of checkboxes (see code below) I wish to use cgi.pm to process it. When I use my @deployBranch = $cgi->{form}{'deployBranch'}; my $list; if ( @deployBranch ) { $list = join ', ', @deployBranch; } else {

Accessing elements of an array passed by reference

2004-11-14 Thread Johnstone, Colin
Gidday all, I wish to access the elements of an array passed by reference #get deploy list my @$deployList = $task->GetVariable('deployList'); foreach( @$deployList ){ } Any help appreciated Thank You Colin Johnstone Interwoven Teamsite Analyst Programmer eGovernment Delivery Team QLD Depar

RE: Unlink ? [edited]

2004-11-14 Thread Johnstone, Colin
:[EMAIL PROTECTED] Sent: Monday, November 15, 2004 2:28 PM To: [EMAIL PROTECTED] Subject: RE: Unlink ? [edited] Johnstone, Colin <[EMAIL PROTECTED]> wrote: Please send replies to the list. : Hi Charles, : : Thank you, I tried this instead. : : my $cmdResult; : : if ( unlink( $src

Unlink ? [edited]

2004-11-14 Thread Johnstone, Colin
Gidday All, Previous email was wrong this is the correct version I want to use the unlink command to programmatically delete files. I have modified this code snippet but it no longer works, I suspect that it's because unlink returns the number of deleted files. my $cmd = qq[unlink $srcFile];

Unlink ?

2004-11-14 Thread Johnstone, Colin
Gidday All, I want to use the unlink command to programmatically delete files. I have modified this code snippet but it no longer works, I suspect that it's because unlink returns the number of deleted files. my $cmd = qq[unlink $srcFile]; $debug->printlog("command: $cmd"); my $cmdResult =

RE: regex help

2004-09-23 Thread Johnstone, Colin
Thank you I musthave just coded something wrong, your right they do work. Sorry! -Original Message- From: Raymond Raj [mailto:[EMAIL PROTECTED] Sent: Friday, September 24, 2004 3:55 PM To: Johnstone, Colin; [EMAIL PROTECTED] Subject: RE: regex help Hi! what's problem in these re

RE: regex help

2004-09-23 Thread Johnstone, Colin
I worked it out myself $safeString = "News & Events"; $safeString =~ s!&!and!g; $safeString =~ s!\s!_!g; thank you Colin -Original Message----- From: Johnstone, Colin Sent: Friday, September 24, 2004 3:32 PM To: [EMAIL PROTECTED] Subject: regex help

regex help

2004-09-23 Thread Johnstone, Colin
Gidday all, Im trying to write a regex to convert spaces to underscores and ampersands to 'and' can someone help. $safeString = "News & Events"; $safeString =~ s/&/and/g; $safeString =~ s/\s/_/g; Regards Colin This E-Mail is intended only for the addressee. Its use is limited to that inten

Site management - content deletion stage 1

2004-09-19 Thread Johnstone, Colin
Gidday all, In our CMS (Interwoven Teamsite) I need to write a content deletion workflow. If a user is deleting a html page I need to parse that page and report on all assets (images, pdfs) attached to the page and delete them as well. How do I go about doing this? I'll do the legwork just broa

RE: First module

2004-09-15 Thread Johnstone, Colin
erties and methods. Hopefully this will at least provide some ideas. -John On Wed, 15 Sep 2004 10:22:36 +1000, Johnstone, Colin <[EMAIL PROTECTED]> wrote: > Gidday all, > > I have written a module to be used with our CMS 'Teamsite' > > I wonder if any of you Perl gu

First module

2004-09-14 Thread Johnstone, Colin
Gidday all, I have written a module to be used with our CMS 'Teamsite' I wonder if any of you Perl gurus can see any holes in this. It has methods to return the following 1) branch path 2) branch name 3) workarea 4) local path any help appreciated thank you Colin given the following file path f

RE: Regex help

2004-09-13 Thread Johnstone, Colin
egards Colin -Original Message- From: John W. Krahn [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 4:06 PM To: Perl Beginners Subject: Re: Regex help Johnstone, Colin wrote: > Hi Jim, Hello, (my name is John BTW) > rather than re-invent the wheel I would prefer if y

RE: Regex help

2004-09-13 Thread Johnstone, Colin
-Original Message- From: Jim [mailto:[EMAIL PROTECTED] Sent: Tuesday, September 14, 2004 3:32 PM To: Johnstone, Colin Cc: [EMAIL PROTECTED] Subject: RE: Regex help > > Hi Jim, > > rather than re-invent the wheel I would prefer if you could > fix this regex I believe it cover

RE: Regex help

2004-09-13 Thread Johnstone, Colin
Hi Jim, rather than re-invent the wheel I would prefer if you could fix this regex I believe it covers all invalid characters one would encounter s/[\w\&%'[EMAIL PROTECTED](\)&_\\+,\.=\[\]]//g; I would then use it as a general purpose regex for validating filenames. Regards Colin > Hi all,

Regex help

2004-09-13 Thread Johnstone, Colin
Hi all, What I would like to do is from a string that represents a Primary Navigation item on our menu e.g News & events create a filename. I firstly need to remove any invalid characters (including spaces) $filename = 'News & events'; $filename =~ s/[\w\&%'[EMAIL PROTECTED](\)&_\\+,\.=\[\]]

RE: Trouble running perl scripts.

2003-03-18 Thread Johnstone, Colin
Colin -Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 19, 2003 14:42 To: Johnstone, Colin Cc: [EMAIL PROTECTED] Subject: Re: Trouble running perl scripts. Johnstone, Colin wrote: > Gidday All, > > I should be past this now. >

FW: Trouble running perl scripts.

2003-03-18 Thread Johnstone, Colin
Gidday All, Further to my previous email If I change the permissions to 555 it works, but if I set it to 777 it doesn't could this be a safeguard that is built into the server? Any help appreciated. Colin -Original Message- From: Johnstone, Colin Sent: Wednesday, March 19, 2003

Trouble running perl scripts.

2003-03-18 Thread Johnstone, Colin
Gidday All, I should be past this now. I hope someone can help, my host refuses to help. I have written this simple perl script to test it on my host. I always have trouble when I write a new script and upload it to this host it runs fine on my server here at work. #!/usr/bin/perl -w print

Check url for form submission

2003-03-09 Thread Johnstone, Colin
Gidday All, I have found this subroutine in someone else's program I need to modify it so it will work on my server. I wish to use it to confirm that only forms submiited from my Domain will be processed. Its the reg ex I don't understand, Can someone help me re-write it. Is it as simple as su

PErl subroutine

2003-03-06 Thread Johnstone, Colin
Gidday All, please help with my subroutine sub cleanText{ my $cleanedText = @_; $cleanedText =~ s{}{}g; $cleanedText =~ s{}{}g; $cleanedText =~ s{<\/b>}{<\/span>}g; $cleanedText =~ s{Fittingly, the first student to arrive on the first day at Booligal Public's new era was Steven Spiers.

Deconstructing a PDF using PERL

2003-03-03 Thread Johnstone, Colin
Gidday All, With a view to accessibility we are limiting our publishing of PDFs on our site. We tend to replace and pdfs by creating HTML pages by cutting and pasting from the PDF to our CMS. Is there a automated way of deconstructing a pdf using PERL. Thanking you in advance Colin Johnsto

Passing a Hash to a Subroutine

2003-02-11 Thread Johnstone, Colin
Gidday All, Im trying to pass a hash to a subroutine now. When passing with other variables do I have to pass it as a reference like I do an array. If so how do you dereference it, if you have to at all. Where am I going wrong? sub generate_navIndex{ my ( $paramPath, $paramPageName, $para

Passing an array to a subroutine

2003-02-11 Thread Johnstone, Colin
Gidday All, A couple of you helped me with this before but I have misplaced my notes I am trying to pass an array to a subroutine and am having trouble. As i am passing other variables as well I know I need to pass it by reference. Am I doing it correctly. $pageContent = format_indexPage( \

RE: FW: Removing HTML Tags

2003-01-22 Thread Johnstone, Colin
Thank you all for your help. -Original Message- From: Toby Stuart [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 23, 2003 13:44 To: 'simran' Cc: '[EMAIL PROTECTED]' Subject: RE: FW: Removing HTML Tags > > > > -Original Message- > > >

Removing HTML Tags

2003-01-22 Thread Johnstone, Colin
Gidday all, When using our CMS (Interwoven Teamsite) I want to remove from any textarea any html tags that I don't want content contributors to use. On in particular is the font tag. Can one use a regex to remove these? I guess Im looking for a regex to remove anything between the font tags e

CSV File Creation

2003-01-14 Thread Johnstone, Colin
Gidday all, Is a CSV a comma delimited list. If so when creating a CSV how does one cope with fields that have commas in them. An address filed for example could be written suite 2, lvl 3. Do you write the field names out with quotes around them? my $filename; $filename = "/home/bdweb8083m

Looping through a Hash

2003-01-08 Thread Johnstone, Colin
Gidday All, Can I do this when looping through a Hash. foreach my($k, $v)( %picDetails ){ do stuff to $v; } Thanking you in Anticipation Colin -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Perl and Arrays

2002-12-22 Thread Johnstone, Colin
John, Im sorry I didn't reply earlier it is just Monday morning here in Sydney and have just returned to work. I have recently discovered these lists, they are great. One of the first problems I faced when I started this job only a year ago was that I had no mentors in my workplace it was jus

killing a hash

2002-12-20 Thread Johnstone, Colin
Gidday all, to kill an array or reset it you do @arrayname(); how do you reset a hash %hashname; Regards Colin Johnstone

RE: Perl and arrays

2002-12-20 Thread Johnstone, Colin
er 20, 2002 21:12 To: [EMAIL PROTECTED]; Johnstone, Colin Cc: '[EMAIL PROTECTED]' Subject: Re: Perl and arrays just one mistake in the code Your elements are comma seperated and you are doing @data = split( /\t/, $element); do a @data = split( /,/, $element); - Ram Colin

Perl and arrays

2002-12-20 Thread Johnstone, Colin
Gidday all, I want to create an array and then remove elemnets one at a time and split on the comma. I've tried this with no success.. #!/usr/bin/perl -w print "Content-Type: text/html\n\n"; my @arrayStuff; $arrayStuff[0] = "albu.htm,3.4.1.5.1,albu_menu.inc,albu.inc"; $arrayStuff[1] = "armi.

RE: PERL String Manipulation

2002-12-19 Thread Johnstone, Colin
Gidday All, Thank You for your help, I must have some other error that I can't find. Regards Colin

PERL string manipulation

2002-12-19 Thread Johnstone, Colin
Gidday all, In PHP if I want to add something to a string I do this $output = ""; $output .= "A"; $output .= "B"; $output .= "C"; $output .= "D"; print $output; How do I do the same in PERL please. Thanking you in anticipation Colin

Re : Reg ex help!

2002-12-19 Thread Johnstone, Colin
Thank You Toby and Mark for your help Colin Johnstone Website Project Officer Corporate Website Unit Public Affairs Directorate ph 9561 8643

Reg ex help!

2002-12-19 Thread Johnstone, Colin
Gidday All, Im reading course names in from a text file and want to remove the course number from the end of each course name. Can someone help me with the regex to do this. e.g Mathematics 2 unit (15240) to give me Mathematics 2 unit Thanking you in anticipation. Colin Johnstone Webs

RE: Regex question

2002-12-12 Thread Johnstone, Colin
Thanks Mate, worked like a treat. Colin -Original Message- From: Aman Thind [mailto:[EMAIL PROTECTED]] Sent: Friday, December 13, 2002 16:39 To: Johnstone, Colin Subject: RE: Regex question Just add another backslash to the "Substitute With" part of the expression as in :

Regex question

2002-12-12 Thread Johnstone, Colin
Gidday all, I have a paragraph of text, I want to convert any double quotes around quoted text to \" is this the correct reg ex $paragraph =~ s{\"}{\\"}g; Thanking you in anticipation Colin Johnstone

FW: Preserving funny characters in email addresses

2002-12-11 Thread Johnstone, Colin
stop it from converting the funny characters before I write it out to the text file or should I run each email address through the regex each time I read the text file into the array that I use. Thanking you in anticipation Colin > -Original Message- > From: Johnstone, Co

RE: Preserving funny characters in email addresses

2002-12-11 Thread Johnstone, Colin
Hi Toby, Thanks for your help again. I'll use the reg ex our system admin guy is reluctant to install new modules on the webserver. Thank You Colin -Original Message- From: Toby Stuart [mailto:[EMAIL PROTECTED]] Sent: Thursday, December 12, 2002 10:59 To: Johnstone, Colin Cc: &#

Preserving funny characters in email addresses

2002-12-11 Thread Johnstone, Colin
Gidday All, I have written a perl cgi mailing list subscription application. How do I preserve funny characters in email addresses for example one subscriber's email address is sorcha.o'[EMAIL PROTECTED] but when written to the textfile where I store subscribers names it is written as [EMAIL

RE: Regex help!!

2002-12-01 Thread Johnstone, Colin
Thanks Danny I must be doing something else wrong, I bet its variable scope, Im just getting my head around it Colin -Original Message- From: Danny Miller [mailto:[EMAIL PROTECTED]] Sent: Monday, December 02, 2002 17:13 To: Johnstone, Colin Subject: RE: Regex help!! Your regex is

FW: Regex help!!

2002-12-01 Thread Johnstone, Colin
Further to my previous message. after fixing the ~= I get the following. I know $screenOutput has a value because I see the html contained in the file Im reading on the screen its just not doing the substitution. please advise. Colin -Original Message- From: Johnstone, Colin Sent

Regex help!!

2002-12-01 Thread Johnstone, Colin
Hi all, Im reading in a file line by line and I want to look for the occurence of this string in $line. Is this the right way to do it. If it finds it it is to inser the value of $screenOutput in its place. if($screenOutput ne ""){ my $responsePage = ""; open(IN, "<$locationResponsePageSkin")

RE: Passing an array to a subroutine

2002-11-26 Thread Johnstone, Colin
Thank you Wiggins, and thankyou also for your help with scoping yesterday. Colin -Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED]] Sent: Wednesday, November 27, 2002 13:08 To: Johnstone, Colin Cc: '[EMAIL PROTECTED]' Subject: Re: Passing an array

Passing an array to a subroutine

2002-11-26 Thread Johnstone, Colin
Hi all, I think somebody asked this the other day. How does one pass an array to a subroutine please Colin Johnstone

Help perl gurus

2002-11-25 Thread Johnstone, Colin
Gidday all, I have written what I will refer to as an include file ( php speak ) and named it press_config.pl The contents is the initialisation of the variables that I wish to use across my mailinglist application. It is below. First problem When I use the require statement to call this file

RE: Calculating currentdate without the time module

2002-11-25 Thread Johnstone, Colin
Hi Toby, Cool, Thanks for your help man Colin -Original Message- From: Toby Stuart [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 26, 2002 15:35 To: Johnstone, Colin Cc: '[EMAIL PROTECTED]' Subject: RE: Calculating currentdate without the time module > -Ori

Calculating currentdate without the time module

2002-11-25 Thread Johnstone, Colin
Gidday all, The time module has not been installed on our server and our server team don't have time to install it so I cant use this command in my script use Time::Local; but I need to calculate todays date. From the following script I can calculate what year it is but how to get the month an

Can perl read a word doc

2002-11-21 Thread Johnstone, Colin
Gidday all, Can I use Perl to open a word document ? Our press releases come to us as word docs, we cut and paste the text into our cms(Interwoven Teamsite), and then publish on the web. Im wondering if I can write some perl code so we can just upload the document and perl will do the rest. T

Reading Emails sent to Server

2002-11-07 Thread Johnstone, Colin
Gidday All, Im writing a double opt in newsletter subscription application. If I get sendmail to send an email to someone, can I write a program to read their replys to enable them to confirm their subscription automagically simply by replying to the email I sent them. Is this the standard pra

RE: Declaring a Hash

2002-11-06 Thread Johnstone, Colin
Thank you all, -Original Message- From: Scott, Joshua [mailto:Joshua.Scott@;Jacobs.com] Sent: Thursday, November 07, 2002 10:15 To: Johnstone, Colin Subject: RE: Declaring a Hash Hello, Here is how you declare hash. my %hash = (); Joshua Scott Security Systems Analyst, CISSP 626-568

Declaring a Hash

2002-11-06 Thread Johnstone, Colin
Gidday all, How does one declare a hash our $hash = (); Colin Johnstone

RE: die not working

2002-11-06 Thread Johnstone, Colin
$record); $subscribers1{$data[0]} = $data[1]; } close IN; -Original Message- From: Nikola Janceski [mailto:nikola_janceski@;summithq.com] Sent: Thursday, November 07, 2002 08:20 To: Johnstone, Colin; '[EMAIL PROTECTED]' Subject: RE: die not working add this: use CGI::Carp '

die not working

2002-11-06 Thread Johnstone, Colin
Gidday all, I assume when using die in this format I should see the error message. #!/usr/bin/perl use CGI qw( :standard ); print header(); $file1 = /web/schooled/www/news/subscribers_news1.txt open IN, "<$file1" or die("Cannot Open: $!"); while( my $record = ){ chomp $record; @data = spl

RE: Include files in PERL

2002-11-05 Thread Johnstone, Colin
Thanks Tim, I'll give it a whirl. Colin -Original Message- From: Timothy Johnson [mailto:tjohnson@;sandisk.com] Sent: Wednesday, November 06, 2002 14:47 To: Johnstone, Colin; '[EMAIL PROTECTED]' Subject: RE: Include files in PERL I think 'use' is what you

Include files in PERL

2002-11-05 Thread Johnstone, Colin
Gidday from downunder, When writing PHP if I want to an include I type include("filename.php"); Is there a similar command in PERL, does require do the job? In my mailing list application I re-use numerous functions and would like to pop these in a function library and include them on every pag

Query String Processing

2002-11-05 Thread Johnstone, Colin
Hi all, I am writing an administration interface to my mailing list. Upon opening the program it displays the email addresses of all the subscribers along with a delete link next to each name. The subscribers are written to a hash. When you click delete link the name/value pair is passed back

Query String processing

2002-11-05 Thread Johnstone, Colin
Hi all, I am writing an administration interface to my mailing list. Upon opening the program it displays the email addresses of all the subscribers along with a delete link next to each name. The subscribers are written to a hash. When you click delete link the name/value pair is passed back

Current Directory Name

2002-10-30 Thread Johnstone, Colin
Gidday All, How do I find out the name of the current directory I am in before I do chdir. Colin Johnstone -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Glob

2002-10-29 Thread Johnstone, Colin
Hi all, I have a program that generates newsletters, on any day any number of newsletters can be produced. The newsletters are produced in two formats html and text. They are named according to the date they are generated and I tack another number on the end to uniquely identify them. So if two

Using Use:CGI to process form variables

2002-10-21 Thread Johnstone, Colin
Hi all, As a Perl Newbie I just felt more comfortable processing form variables using the method I'm most comfortable with As Jenda pointed out in a previous post that this is not the best method. > #read STDIN, $PostData, $ENV{'CONTENT_LENGTH'}; > > #print "post data =$PostData"; > > #postda

RE: A better way to handle array index?

2002-10-19 Thread Johnstone, Colin
That would be a hash. (or an associative array) for example I read my form variables into a hash for processing. I then reference them by the form fieldname. #read STDIN, $PostData, $ENV{'CONTENT_LENGTH'}; #print "post data =$PostData"; #postdata will look like this #[EMAIL PROTECTED]&radActi

RE: How to wrap a sentence?

2002-10-18 Thread Johnstone, Colin
Hi Chris, I had to do something similar I am producing a text newsletter I do not want my lines of text in each paragraph to exceed 75 characters. Basically you take your string of text and assign the full words to an array you can use the split function to do this. So now you've got your array

copywrite symbol

2002-10-18 Thread Johnstone, Colin
Hi all, How do I print out the copywrite symbol to a text file please. Colin Johnstone Website Project Officer Corporate Website Unit Public Affairs Directorate NSW Department of Education and Training AUSTRALIA ph 9561 8643 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional comm

RE: Get Script to run same time each day automatically

2002-10-16 Thread Johnstone, Colin
Thanks Vinai, I will talk to our server team Colin Johnstone Website Project Officer Corporate Website Unit Public Affairs Directorate NSW Department of Education and Training AUSTRALIA ph 9561 8643 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROT

Get Script to run same time each day automatically

2002-10-16 Thread Johnstone, Colin
Gidday from Downunder, Is it possible to write a script that runs automatically at the same time each day. Why you might ask? You see we want to send out a newsletter notifying journalists of our latest press releases. The newsletters are generated automatically by our CMS (Interwoven Teamsit

Sendmail Problems

2002-10-15 Thread Johnstone, Colin
Gidday from Downunder I have loaded the same script on two servers one will send to my home account and the other won't. I know sendmail path and perl path are correct in both instances while it won't send to my home account it will send to my hotmail account. Any Ideas! #!/usr/bin/perl pri

RE: Hashes

2002-10-13 Thread Johnstone, Colin
Hi All, Yes silly me, I found the problem the second record replaced the first as the key was the same. Thank You Colin Johnstone Website Project Officer Corporate Website Unit Public Affairs Directorate ph 9561 8643 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e

Hashes

2002-10-13 Thread Johnstone, Colin
Gidday from Downunder, Im writing the script to read the the contetns of a text file into a hash, the text file has two records [EMAIL PROTECTED]|html [EMAIL PROTECTED]|txt My script is below open IN, "<$mailinglist"; while( my $record = ){ @data = split( /\|/, $record); $records{$data[0

Sending HTML Emails with SENDMAIL

2002-10-08 Thread Johnstone, Colin
HI all, I need help sending HTML emails with sendmail have tried this $from="foo\@bar.com"; $to= shift; ## yes this is enclosed in a function and I pass the email address as a parameter $subject="Latest News!"; $sendmailpath="/usr/sbin/sendmail"; open (SENDMAIL, "| $sendmailpath -t"); print

How to send HTML emails with Sendmail

2002-10-07 Thread Johnstone, Colin
Hi, I have successfully sent just plain text emails using sendmail but can I send HTML emails, I have tried this with no success. $from="foo\@bar.com"; $to= shift; $subject="Latest News!"; $sendmailpath="/usr/sbin/sendmail"; open (SENDMAIL, "| $sendmailpath -t"); print SENDMAIL "Subject: $sub