Perl Advice


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Perl Advice
# 1  
Old 07-22-2010
Perl Advice

Hi all, I have been asked to have a look at a perl script written some time ago and as I have no knowledge or perl I have resulted to hacking it about.

The script is to grab data using an ftp connection and once data has been grabbed I need to cat the files to /dev/nul.

I think the best place for this to take place is just after the rename takes place here;

Code:
                              #
                                # file size and modification time
                                # have not changed so assume stale
                                # and file downloaded successfully
                                #
                                if (rename($temp_file, $real_file)) {
                                        #
                                        # build log message
                                        #

But as I have no knowledge of perl I'm not sure of the correct syntax I should use to achieve this.

Can one one offer any advice please?

Thanks Smilie

---------- Post updated at 03:43 PM ---------- Previous update was at 03:24 PM ----------

Think I've worked it out;

Code:
system(“cat “ . $real_file . “ > /dev/null 2>&1”);

JayC89
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Solved] Permission problem, programming advice needed, Perl

Hi all, I have written a wrapper script in Perl which will be used on AIX, Linux and Windows and I do not want to change any code for the needs for a specific OS if avoidable. It works fine so far on all 3 OSes, not blowing up any stacks any more, but I am unsure how to handle writing log files... (7 Replies)
Discussion started by: zaxxon
7 Replies

2. Shell Programming and Scripting

Need Advice

Guys, Can you tell me what value would additional knowledge of PERL and CGI scripting will add to my skill set of UNIX shell scripting and ORACLE PL/SQL? I understand that PERL is a good tool for text processing. (1 Reply)
Discussion started by: yabhi_22
1 Replies

3. Shell Programming and Scripting

Advice on script

Hi folks, I use following script:- #!/bin/sh # cd Linbread TODAY=`date +"%m%d"` DATA=`grep $TODAY linbread.dat` HOUR=`date +"%H"` if then TOD="Morning" elif then TOD="Afternoon" else TOD="Evening" fi echo $DATA | gawk -F"|" '{printf("%s\n\n%s",$2,$3)}' > $$tmp fold -s -w60... (0 Replies)
Discussion started by: satimis
0 Replies

4. Solaris

advice on patching

Hi.. I have 3 t5120s, with 4,2,2 zones respctively. All 3 systems are Solaris 10 and the zones too. I would like to pach these systems. Can some one tell me best policies on patching such systems with zone. I assume only global zones will have to be patched and then non global zones get... (2 Replies)
Discussion started by: upengan78
2 Replies

5. Red Hat

Any advice would help

Hi everyone. I must admit up front that I am not very strong when it comes to Linux. I am actually a Windows guy, but don't let that count against me. :) I work for a very small company so we do not have a Server/Linux Admin on staff. Most of our needs have been handled by our WebHost. We have... (2 Replies)
Discussion started by: liquidstyleb
2 Replies

6. UNIX for Dummies Questions & Answers

need advice

i am currently running windows vista home premium, i want to install unix because i just started a computer programing course, i am just wondering if i install unix will i still have vista?? how does it work? will i get a choice of which os to run on system startup?? (1 Reply)
Discussion started by: naner9
1 Replies

7. Shell Programming and Scripting

looking for advice...

Hi. First of all, Im an msoft guy, and when it comes to linux/unix, I'm retarded. Here is what I'm trying to do. I want to start I want to automatically connect to a remote server. Then I need it to login(https) -insert the licensce in the box(vi) -based on that licensce, the... (1 Reply)
Discussion started by: bravo24601
1 Replies

8. What is on Your Mind?

Career advice

I am a junior unix sys admin (Tru64) I have been in this job for 9 months and I am quite worried. When I first got the job I was delighted as I was finally in a job where I could have the chance to be a specialist in a field rather than being a general support guy (i graduated from uni and got... (5 Replies)
Discussion started by: supadid
5 Replies

9. Shell Programming and Scripting

perl module installation problems... experts advice needed,...

---------- This is perl, v5.6.1 built for MSWin32-x86-multi-thread (with 1 registered patch, see perl -V for more detail) ----------in win 2000 advanced server,.. i am somewhat comfortable with perl but i am new to perl modules.. when i tried to install xml::simple and xml::parser there... (4 Replies)
Discussion started by: sekar sundaram
4 Replies

10. UNIX Desktop Questions & Answers

Looking for some advice

I am looking for some advice on wether to use unix or red hat linux? I have played with most windows OS and Mac OS up to in and including OS X. any and all advice would be appreciated (4 Replies)
Discussion started by: justawind
4 Replies
Login or Register to Ask a Question
SIEVESHELL(1)						User Contributed Perl Documentation					     SIEVESHELL(1)

NAME
sieveshell - remotely manipulate sieve scripts SYNOPSIS
sieveshell [--user=user] [--authname=authname] [--realm=realm] [--exec=script] server[:port] sieveshell --help DESCRIPTION
sieveshell allows users to manipulate their scripts on a remote server. It works via MANAGESIEVE, a work in progress. The following commands are recognized: list list scripts on server. put <filename> upload script to server. get <name> [<filename>] get script. if no filename display to stdout delete <name> delete script. activate <name> activate script. deactivate deactivate all scripts. OPTIONS
-u user, --user=user The authorization name to request; by default, derived from the authentication credentials. -a authname, --authname=authname The user to use for authentication (defaults to current user). -r realm, --realm=realm The realm to attempt authentication in. -e script, --exec=script Instead of working interactively, run commands from script, and exit when done. REFERENCES
[MANAGESIEVE] Martin, T.; "A Protocol for Remotely Managing Sieve Scripts", draft-ietf-managesieve-03.txt, Mirapoint, Inc.; May 2001, work in progress. AUTHOR
Tim Martin <tmartin@mirapoint.com>, and the rest of the Cyrus team <cyrus-bugs@andrew.cmu.edu>. perl v5.16.3 2014-06-10 SIEVESHELL(1)