Re: to delete a file

2001-06-21 Thread n6tadam

Hi,

Of Couse!! I had forgot about the unlink () command.

Thanks for that reminder Kevin :-)

Regards,

Thomas Adam

- Original Message -
From: Kevin Meltzer <[EMAIL PROTECTED]>
To: n6tadam <[EMAIL PROTECTED]>
Cc: Stéphane JEAN BAPTISTE <[EMAIL PROTECTED]>;
PERL <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 3:11 PM
Subject: Re: to delete a file


> On Thu, Jun 21, 2001 at 03:04:21PM +0100, n6tadam
([EMAIL PROTECTED]) spew-ed forth:
> > Hi,
> >
>
> [snip]
>
> >
> > Of course, from a perl script, you can either use:
> >
> > system("/bin/rm -f /path/to/filename");
> >
> > or
> >
> > `rm -f filename`
>
> Don't do that. Just use unlink()
>
> perldoc -f unlink
>
> Cheers,
> Kevin
>
> --
> [Writing CGI Applications with Perl - http://perlcgi-book.com]
> Nuclear explosions under the Nevada desert? What the f*ck are we testing
for?
> We already know the sh*t blows up.
> -- Frank Zappa
>
>


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: to delete a file

2001-06-21 Thread n6tadam

Hi,

Usually, one uses the following command (from the shell prompt)

"rm /path/to/file/filename"

To supress the confirmation message, use:

"rm -f /path/to/file/filename"

To delete recursively (i.e. a directory), and make it verbose to the screen:

rm -rfv /path/to/directory

Does that help.

Of course, from a perl script, you can either use:

system("/bin/rm -f /path/to/filename");

or

`rm -f filename`

I hope that helps,
Regards,

Thomas Adam  (VI form student)
Linux Co-ordinator at the Purbeck School (Network Support)
Wareham,
Dorset,
UK
- Original Message -
From: Stéphane JEAN BAPTISTE <[EMAIL PROTECTED]>
To: PERL <[EMAIL PROTECTED]>
Sent: Thursday, June 21, 2001 3:03 PM
Subject: to delete a file




How can I delete a file ?

thanks




Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: Learning Perl chpt.13 problem

2001-06-19 Thread n6tadam

Hi,

s/#.*/##

The above is used either to indicate a substitution of a string. The "s"
indicates substitute. The rule is, that whatever you specifiy after the "s",
is the regex that you are looking for (this in the above case "#.*"). This
is then separated by a "/". Anything after is the replace parameter, ended
by a "/".

There are other switches that can be placed after the last "/", usually:

g   (indicates a global search/replace)
d   (delete the line)

HTH,

Thomas Adam



Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: STDERR Question

2001-06-19 Thread n6tadam

Hi,

I think this is possible

while (<>) {
open(STDERR > /file)
close(STDERR)

}

I think thats right (I'm rather new to perl).

HTH,

Thomas Adam
- Original Message - 
From: Conrad, Bill (ThomasTech) <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, June 19, 2001 12:41 PM
Subject: STDERR Question


> Hi All
> 
> Does PERL write compile errors and warnings to STDERR and if so is
> there any easy way to have them written to a file rather then to the
> console?
> 
> Thanks
> 
> Bill Conrad
> 
> 


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: Telnet

2001-06-14 Thread n6tadam

Hi,

Telnet, gives you the ability to access a remote machine across a network,
however, I would advise against using telnet. Instead, I recommend using SSH
(Secure SHell), which is much more secure.

Regards,

Thomas Adam

- Original Message -
From: Sally <[EMAIL PROTECTED]>
To: perl <[EMAIL PROTECTED]>
Sent: Thursday, June 14, 2001 2:17 PM
Subject: FW: Telnet


>
>
> -Original Message-
> From: Sally [mailto:[EMAIL PROTECTED]]
> Sent: 14 June 2001 13:53
> To: perlcgi
> Subject: Telnet
>
>
> I've seen lots of references to telnet, but I can't find an explanation of
> what it actually is. Is it similar to FTP?
>
>
>


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: Doubt in understanding

2001-06-08 Thread n6tadam

Hi,

That expression looks more like something one would encouter in a BASH
script.

Thomas Adam

- Original Message -
From: Jeff Yoak <[EMAIL PROTECTED]>
To: Rajanikanth Dandamudi <[EMAIL PROTECTED]>; Perl beginners
<[EMAIL PROTECTED]>
Sent: Friday, June 08, 2001 10:22 AM
Subject: Re: Doubt in understanding


> At 02:16 PM 6/8/01 +0530, Rajanikanth Dandamudi wrote:
> >Hello,
> >
> > I had a problem understanding what the
> >expression ${1+"$@"} mean? can someone help me in
> >understanding this?
>
> That's bizarre.  In what context did you encounter it?
>
> Cheers,
> Jeff
>
>
>


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: CGI-BIN

2001-06-05 Thread n6tadam

Hi,

Perhaps I can join in the conversation?? Are you running apache as your
websever? If so, you can specify mutiple aliases so that the main /cgi-bin/
folder is aliased to other folders of your convienience.

If you need help, let me know.
Regards,

Thomas Adam

- Original Message -
From: Hasanuddin Tamir <[EMAIL PROTECTED]>
To: Exile <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, June 05, 2001 11:10 AM
Subject: Re: CGI-BIN


> On Tue, 5 Jun 2001, Exile <[EMAIL PROTECTED]> wrote,
>
> > Hi All,
>
> Hi Exile,
>
> > I 've try to write some CGI scripts, however, I have to put my scripts
in
> > cgi-bin..  so... anybody tell me what is this?
>
> The cgi-bin directory is by convetionally a place to put all CGI programs.
> It's provided so that you don't have to mess around with your everywhere
> scripts.
>
> > I mean anybody can tell me some concepts about redirect?
>
> There's nothing special about redirect.  It's, like the name implies,
> a mechanisme to redirect request from original URL to another one.
>
> >  My most
problem
> > is, I can't read write files in my home directory.
>
> You mean from the browser?  The browser requests certain resource to the
web
> server.  And like all processes, the web server runs with certain (usually
> low) privilege.  With this privilege, the web server doesn't get
permission
> to access any files in your home directory.  Usually, it's not a problem
> though.  But if it is for you, you can ask the sysadmin about this.  Every
> system can have different way to implement this.
>
> > The other case is , is that cgi-bin is not a real folder? Is that
helpful
> > to hide my scripts from users?
>
> It could be real or virtual, depends on how the adminstrator arrange it.
> Files in cgi-bin are expected to be executed by the web server, not to
> be shown to the browser.  Is that you mean by hide your scripts from user?
> Or you mean (local) users, just like you?
>
> If the cgi-bin content is accessible (readable) by the web server, then
> other local user will likely be able to read the files in that directory.
>
> > Besides, is that the cgi script can be called globally within my
account?
> > such as, I can put 
wherever?
>
> Yes.  I can even call your /cgi-bin/myscript.pl from my computer provided
> that I know the base URL :-)  But it's not something you should worry
> about.
>
>
> s.a.n
> --
> Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com
>
>
>


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Re: syntax/definitions

2001-06-04 Thread n6tadam

Hi,

Check anyone of the numerous perl man pages under Linux. I believe that I
have seen them listed, but cannot for the life of me remember where :-)

HTH,

Thomas Adam

- Original Message -
From: Sally <[EMAIL PROTECTED]>
To: perl <[EMAIL PROTECTED]>
Sent: Monday, June 04, 2001 9:30 AM
Subject: syntax/definitions


> Does anyone know if there's somewhere, on the web, that I can find a list
of
> syntax/defintions for all Perl commands, libraries, modules etc
>
> Thanks
>
> Sally
>
>
>


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Help with cgi-script

2001-05-14 Thread n6tadam

Dear List,

I am trying to write a cgi-script that adds a new user to my linux box via a
web based form.

The trouble is, is how do I pass variables to the program "passwd"?? This is
so that when the password is sent via the form, it erncrypts the password,
and adds the user??? Has anyone got any ideas? Or has a similar cgi-script I
could use??

I am using the shadow password suite, if that helps.

Thanks in Anticipation,
Regards,

Thomas Adam



Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




Help needed with perl script......

2001-05-04 Thread n6tadam

Dear List,

I have attached a copy of my perl script that I am writing. I am finding
that I am having trouble with it. I am sure that there is a simple
solution..

To cut a long story short, I have written a bash script, which uses sed and
awk to convert the logfile that is generated by the Unix squid caching
program. What this script does, is to convert the unix timestamp, and print
various columns (which in their raw format are separated by a space), as a
CSV file (comma delimited file). Thus, the final product, should be that the
output field separater is a comma.

I have included my perl script thus far. The problem that I am having is
that once it has converted the timestamp (which it does), it then splits the
rest of the file into comma separated fields, but rather than put them into
the designated file, echos them to the screen. Why is this??? I have tried
in vein to fix it, but I must be over-looking something.

Thanking you in anticipation,
Regards,

Thomas Adam
Linux Co-ordinator at The Purbeck School (Network Support)

e-mail: [EMAIL PROTECTED]
website: www.squidproxyapps.org.uk


 squidlog.perl


Thankyou All.......

2001-05-02 Thread n6tadam

Dear List,

I would just like to say thank you to all the people who help me with
getting perl to open to and read a file. I know that this is such a simple
thing to do, but having someone else explain it, definately clarified it for
me :-)))

Thanks Again,
Regards,

Thomas Adam


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk




I am a real begginer to perl......

2001-05-02 Thread n6tadam

Dear All,

I wonder if someone could help me. I have been programming in bash for years
now, but I have decided that I would like to use perl.

My question is: "how do I tell perl to open a file for reading, do various
commands, and then output those changes to a new file"???

Thanks in Anticipation,
Regards,

Thomas Adam


Please note that the content of this message is confidential between the original 
sender and the intended recipient(s) of the message. If you are not an intended 
recipient and/or have received this message in error, kindly disregard the content of 
the message and return it to the original sender.

If you have any complaints about this message please reply to:
   [EMAIL PROTECTED]

The Purbeck School E-Mail server running:
   users.purbeck.dorset.sch.uk