Programming :: Simple Perl Log Code Not Working?
May 25, 2010
I just upgraded servers, and I'm now on 'perl v5.8.8 built for i386-linux-thread-multi' and a simple log script doesn't work. I got it changed to
Code:
#!/usr/bin/perl
use strict;
[code]....
View 4 Replies
ADVERTISEMENT
Feb 16, 2011
This is my sub;
Code:
sub projName
{
print "Enter project name: " ;
$PROJ = <STDIN>;
print "";
[code]....
I can call this routine and it works fine when I enter a valid name for $PROJ. If I enter an invalid name it goes to the else block and prints the statement. However, it does not call itself. Instead the script just exits.I've googled 'perl recursive subroutines' and the example don't appear to be doing anything different.
View 4 Replies
View Related
Nov 5, 2010
i am trying to do something very simple like a header and a footer for my first perl programs, what iam trying to do is that when i create a file in vim: lets say hello.pl , i would like that file to have already this in its header:
#!/usr/bin/perl
and this on the footer:
print "
";
so that i dont have to type everytime #!/usr etc i tried to do it this way but i get weird vim errors: header is a file that contains the header and footer $ vim hello.pl;header > is there another way to do it as a function in bash or some other one liner command?
View 1 Replies
View Related
Mar 17, 2010
I just wrote a simple perl script to compare the following two files
[Code]...
View 7 Replies
View Related
Apr 30, 2010
I have created a simple download schedular with source-code give below :
---------------------record_strokes.sh-------------------
touch /home/student/packs/lynx/logfile
lynx -cmd_log /home/student/packs/lynx/logfile
[code]....
View 10 Replies
View Related
Jun 3, 2010
I want to write some script to do a job which is post some data to the website every one hours .I find some information say the Perl can do this job .I know I can write by the vim.but is these any tools can help for coding .may be it will prompt the class .what tools you use ?
View 10 Replies
View Related
Nov 29, 2010
when I execute the command from the shell command line - it works and no error code.if I do the exact same command from a perl file - it fails with code 32512.the file is created from the same perl script that runs the command that fails. file permission is 0664.
Code:
#! /usr/local/pkg/perl-5.8.8/bin/perl
print "Content-type: text/html
[code]...
View 3 Replies
View Related
Jan 20, 2010
I've been requested to modify a perl backup script we use which mounts a networked NAS machine. The actual mount command is called inside a system() command. In testing, I can do a test of the return value, so I'm able to tell whether or not I've mounted properly, but I can't make heads or tails out of the return on deliberate errors. (Such as mounting a non-existent box.) I'm displaying the returned value, which is 256 in my tests. The man page for mount listed error messages with values from 1 to 64, but no higher. Am I drawing this error value from the system command somehow? And what would be the best way to determine what this error means?
View 6 Replies
View Related
May 13, 2010
I am creating a simple program using C# to print the contents of the todo.txt file once it has run. Problem is when I run the program, I get this warning.
PHP Code:
[code]....
View 12 Replies
View Related
Jul 24, 2010
I really would like Perl Qt4 bindings. The best I could find is this:[URL]The problem is that the sources would not compile, and the RPMs are for 32-bit machines.Is there really no such thing as good Perl Qt4 bindings?
View 8 Replies
View Related
May 2, 2010
how can i actually switch to another directory with "chdir" in perl.like the we used to do is bash as:
Code:
$cat abc
cd Desktop/
[code]...
View 1 Replies
View Related
Aug 26, 2010
I am new to perl scripting and wrote a perl script to read the directories and files and count the no of files in each directory and generate a log file. The problem is it is not printing anything to the log file. I am copying the script below.
!/usr/local/bin/perl
$dir= 'c:My ProjectsPerl ScriptsNew Folder' ;
$directory_count = 0;
$file_count=0;
[code].....
View 14 Replies
View Related
Oct 7, 2010
i'm a college student studying pc programing, and i was given today a special work and i have to program using miranda... which i've never used it >.< can anyone give me a hand to where to download, how to compile, and a simple tutorial for making a simple program or something?
View 3 Replies
View Related
May 17, 2010
I have written FORTRAN77 code,also a makefile. But is not working at all. how to start looking for errors?
View 9 Replies
View Related
Dec 11, 2010
I actually thought there was something wrong with my programming skills.ut after I compiled the same code using Visual Studio, it worked. So here's the code that doesn't seem to be working right with gcc compilers, but they do compile. Note I'm using the Cygwin 3.4.4 version of gcc and 4.5.1 version of gcc from MinGW.
Code: #include <stdio.h>
#include <math.h>
int main()
[code]...
View 5 Replies
View Related
Oct 16, 2010
I am passing an array in function. I want to read the first content again and again until it is empty so
function calltoarray
{
read $1[0]
while [ ! -n "$1[0]" ]
do
echo empty
read $1[0]
done
}
But the code is not working. If we just press enter without value at read $1[0]. It do not get into while loop.
View 2 Replies
View Related
Feb 25, 2010
I am piecing a Mandelbrot generator up, I have one working to produce a 1,500 x 1,500 picture (which is fairly accurate).
I would like to increase the resolution over 100,000 x 100,000 + (into the millions x millions).
How I can achieve this? What kind of buffer sizes do I need?
(note this code doesnt have any memory allocations yet)
Here is my code so far:
The program outputs the Mandelbrot as a .tga file. I calculated the image on fixed axis of -2 to 2 (on the x and y axis). Image produced: [url]
View 12 Replies
View Related
Apr 30, 2010
I have created a simple download schedular with source-code give below :
---------------------record_strokes.sh-------------------
touch /home/student/packs/lynx/logfile
lynx -cmd_log /home/student/packs/lynx/logfile
[code]....
View 1 Replies
View Related
Jan 2, 2011
I noticed in phpmyadmin that we can export a database in type update. Indeed we have update... in place of insert.... is there anyone know if it possible by a command line or by a simple PHP code ?
View 1 Replies
View Related
Apr 19, 2011
I need to refer a sample code to develop a network simulator using c++/system c as back end and perl scripting asd front end.CAn anyone please refer to me any websites were this kind code is given.I do not want to use this otcl script language so wothout this is any code available just for sample so i wii know were to start and develop my own code.
View 3 Replies
View Related
Mar 30, 2011
I need to rewrite the selenium java code into its equivalent php code.
View 5 Replies
View Related
Feb 3, 2010
I have this one last task for this app I've been working on (should have picked something easier for my first project)
It has working "def sav_scr_vars" and "def AddEntry" but these save to a fixed filename when save as defults or ok button is clicked. This is fine but I want to be able to save via the same proccess to a named ~/bin/settings/xxx.set file what I did is clone the to above def's and try to edit them I got the "read file" to work fine from a saved file in this manner. but I can't seem to get the save to filename to work without errors. The cloned def's are "save_as" and inmain.py "write_config2"
the camm2.defaults file goes in ~/.hpgl
copy and paste this to ~/.hpgl/camm2.conf
~/.hpgl/camm2.defaults
The file is always to have a .set extension and only read and write to ~/bin/settings
View 1 Replies
View Related
Apr 11, 2011
I need help as I am not proficient with Linux C++ Programming. There are two parts which I need to do in the coding provided below.
1. Produce the program so it can output the word "Hey there!" and wait two minute and print the word "See you later!".
2. Produce the program that will output the text "Cool" every 20 seconds by setting a periodic task.
Quote:
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hey there!
[Code]...
View 3 Replies
View Related
Feb 12, 2011
im trying to build a simple program for my C programming class, this is the source code
#include <stdio.h>
int main()
{
int length, width, length, height, area, perimeter;
perimeter = width + length + height;
area = width * length + heigth;
[Code]...
i dont see any error (you might)but every time i run it it runs but after it asks me to input for the width i do it but it doesn't take me to the length, it just stays blank until i input another value in the same place for the width, it asks me for 4 inputs in total i don;t know why, and after i run it different times it gives me different values for the perimeter and are. how can I fix this?
View 5 Replies
View Related
Jul 21, 2010
Where is the perl module for programming with sockets?
View 4 Replies
View Related
Mar 26, 2011
How to create a simple Makefile using C....
View 3 Replies
View Related
Nov 7, 2010
I have been looking at: ut a lot of it is to do with files and numerical comparisonswhat would be the bash equivalent of:if (http isin $2) { do something }
View 2 Replies
View Related
Nov 4, 2009
I am trying to create a function that takes a pair of a high and a low limit, and returns an arbitrary number between them. Below is my attempt to create a function that accomplishes this by checking to see if they are equal, and if not, subtracts a very small number from the high limit and returns the result.
View 2 Replies
View Related
Apr 27, 2010
Trying to learn python. Going well, but I have run into a minor speed bump. I wrote a simple program to see if Python was set up correctly. Wouldn't you know it, the thing pops open and then closes again. I put raw input fields there to stop the program, but they didn't work. The program is:
Code:
x = raw_input("Please input your name: ")
print "Hello " + x + ". Good to meet you."
raw_input("Press Enter to exit")
And as for python, I have installed the following packages. The program was made in IDLE using Python2.6 I just started learning python a few days ago, so this may be a really small mistake.
View 1 Replies
View Related
Dec 19, 2010
Xsane is no doubt wonderfully competent, but far too complicated for casual use.
But I am having a problem with Simple Scan, in that I can't seem to get selected resolutions to have any effect.
A typical A4 mainly-text document I am playing with, ends up as:
My Epson V200 scanner allows normal resolution selection with Xsane or with Epson's iscan application.
View 1 Replies
View Related