LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-14-2003, 01:47 PM   #1
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Rep: Reputation: 30
simple Perl question


How can I run a perl script, but make it so no errors are shown... there are some simple things that show up, like "Variable a was only use once, might be a typo"

thanks
 
Old 11-14-2003, 02:16 PM   #2
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
./script.pl 2>/dev/null

That will re-direct stderr to /dev/null all other output
will be written to the screen

Edit:
If you post the code
some one might be able to help out
more trying to stomp out warnings/errors

Also are you using -w or strict?
You could try not using them,
although I like them for safety's
sake.

Last edited by LogicG8; 11-14-2003 at 02:18 PM.
 
Old 11-16-2003, 09:43 PM   #3
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
Right, -w and strict will give warnings about variables declared but not used.

true_atlantis, post the code and you will get a better understanding of WHY you are getting errors. A supresseed error may not give you any problems today, but if you build on your script, it will come back to bite you!
You may also want to look at the beginners perl mailing list It's a great resource with lots of helpful people.
HTH!
 
Old 11-17-2003, 01:00 PM   #4
true_atlantis
Member
 
Registered: Oct 2003
Distribution: fedora cor 5 x86_64
Posts: 639

Original Poster
Rep: Reputation: 30
thanks for all the help... the reason the errors were coming up was because of -w i didnt know exactly what it meant... thanks
 
Old 11-17-2003, 01:53 PM   #5
LogicG8
Member
 
Registered: Jun 2003
Location: Long Island, NY
Distribution: Gentoo Unstable (what a misnomer)
Posts: 380

Rep: Reputation: 30
I'm glad we could help you out,
but you might consider keeping -w
and trying eliminate the complaints
it makes.
 
Old 11-18-2003, 08:37 PM   #6
TheOther1
Member
 
Registered: Feb 2003
Location: Atlanta, GA
Distribution: RHAS 2.1, RHEL3, RHEL4, SLES 8.3, SLES 9, SLES9_64, SuSE 9.3 Pro, Ubuntu, Gentoo
Posts: 335

Rep: Reputation: 32
the errors aren't because of -w, it's something in your code! -w just warns you about them. The errors are still there and it is a very good idea for the first two lines of your code to be:

#!/usr/local/bin perl -w
use strict;

Just my $0.02 worth!

BTW: The error message looks like you defined a variable ($a) but didn't use it anywhere after defined it.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
simple Perl Question whohasit Programming 3 11-05-2004 10:52 AM
Simple Perl Question jacksmash Programming 1 11-13-2003 09:17 PM
Simple Perl question! Please help! jacksmash Programming 4 11-07-2003 05:56 AM
Simple Perl Question Danny.au Programming 6 07-18-2002 09:46 AM
A simple perl programming question J_Szucs Programming 12 07-14-2002 10:03 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration