Programming :: Simple Header For Perl Programs?
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
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
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
View Related
Mar 17, 2010
I just wrote a simple perl script to compare the following two files
[Code]...
View 7 Replies
View Related
Jan 22, 2010
I used to run this script just fine on my old server (Debian 5 Lenny x32)¦. but doesnt seem to work with this new one though both will have different software installed.I tell the script to load and I get: 04:55 -!- Irssi: Error loading module testScript/testScript: /user/.irssi/scripts/autorun/testScript.pl: invalid ELF header
The script code:
Code:
#/script load autorun/testScript.pl
use Irssi;
use Irssi::Irc;
#use strict;
use vars qw($VERSION %IRSSI);
[Code]...
View 2 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
Feb 21, 2010
I installed ubuntu on a spare computer that i have and i need to write some simple programs in C. Only problem is that i'm not sure how to do that. Do i need to install some sort of C compiler?
View 12 Replies
View Related
Jun 29, 2011
Big n00b on Ubuntu 11.04, and tried to look around on the web for guids to install simple programs but I didn't find any good ones. So of you guys have any guids how to install program like uTorrent, AIM and VLC it would be very muvh.
View 6 Replies
View Related
Nov 22, 2010
I have got red hat5 installed on my pc,but not able to run perl or php programs on it. only html display can be obtained,but perl and php programs are not running on firefox browser.when executed,web browser page with server not found msg is displayed.
View 11 Replies
View Related
Jul 7, 2009
I ve been writing perl scripts for testing.( i am into telecom testing) I require a gui based tool where in the scripts can be loaded and run with one click of mouse? GTK is one option i got. But anyone knows any tool which is more user friendly, require less tweaking around for the set-up and is somewhat readymade for running perl scripts? And which is open source and can be downloaded from internet?
View 1 Replies
View Related
Jul 25, 2011
I am trying to write a program that will send a packet to a server as a different IP address so I can test my firewall rules as I only have access to a couple of machines:
Code:
int my_socket;
struct sockaddr_in sin;
[code]....
View 2 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
Jun 16, 2010
I want to use kmalloc() to allocate contiguous memory on ram. But I can not seem to find the required header file(s) like linux/slab.h. I suppose I do not have the required library and I certainly do not know what and where to look.
View 14 Replies
View Related
Jan 15, 2010
I am having trouble getting some code to work. It takes an input file (csv) and converts it to an XLS. The problem is that I can't seem to get a header to be printed first...
Code:
use Spreadsheet::WriteExcel;
my $input = $ARGV[0];
[code]...
View 5 Replies
View Related
Oct 10, 2009
I want to get files header as much as possible which are mostly used so how can i get jpeg file header using C ?
If any other headers of MS Office is possible for U.
View 7 Replies
View Related
Mar 10, 2010
I have been a predominant Windows user for a long time but shifted to Ubuntu recently. I was just trying out a few basic C functions when i realized that the "conio.h" header file isn't included in the libraries and therefore i was unable to use the "clrscr()" function.
I downloaded a tarball which contained the necessary library and header files including conio.h. Once extracted, i specified the location and included in the program as " #include "path to the header file" ".
I still didn't call the "clrscr()" function, and it compiled successfully. Next i edited the program to call that function and it gave the following error...
How i can add new libraries in the future?
View 14 Replies
View Related
May 8, 2010
I have 3 files: main.c, mylib.h, mylib.c Now I want to put mylib.h into : /usr/include/mydir/mylib.h And I create a static library: libmylib.a, and put into the folder: /usr/lib/mydir/libmylib.a Then I compile: $ gcc -o main main.c Then I got linking error
Code:
main.c:(.text+0x3e): undefined reference to `extract_v1'
main.c:(.text+0x7b): undefined reference to `modify_v1'
collect2: ld returned 1 exit status
So I try with -l options: $ gcc -o main main.c -lmylib I still got error
Code:
/usr/bin/ld: cannot find -lmylib
collect2: ld returned 1 exit status
Any idea about this?
Also, I want to ask about: how to create my own header and library to put into /usr/include/mylib/ and /usr/lib/mylib/, so when I use function in my program, the compiler will automatically link to library. It's like when you #include <stdio.h>, and you compile: $ gcc -o program program.c, you don't need to specify any linking folder or library.
View 4 Replies
View Related
Feb 14, 2011
New to programming having issues reference header files.
Not sure how to put the fomula in headers below:
Program
using namespace std;
View 7 Replies
View Related
Feb 26, 2010
I have written a simple library and ended up with a .so file. I have a header file from writing the code that describes how to use the functions in the source code I have written. I think this .h files needs to be available to other programs that access this code.
I have seen lots of tutorials on how to copy the .so file to the relevant directories and make links with the version number. What I can't find is where to put the header file so that any programs I write to use my new library can access the header.
Hope this makes sense. For example, I might use <stdio.h> normally, I will need to access <mylibrary.h> once mylibrary.so is loaded (as far as I understand!)
It's weird, I've been using C compilers for embedded processors over ten years now and never given a second thought to how libraries and headers work behind the scenes!
View 6 Replies
View Related
Aug 19, 2010
I am new to ubuntu.I have done some programming in c++ under windows using graphics.h header file.I want to implement my programs in ubuntu.How can i do this?I am writing a program.
View 4 Replies
View Related
Nov 1, 2010
Say I have a directory structure:
And other.c has:
How do I setup the CMakeFiles.txt files in each directory, so the executable "program" (from program.c) is created.
Currently I get the error:
View 1 Replies
View Related
Jan 29, 2010
I installed Codeblocks and build some programs, but I have two questions:1. Where are my header files placed, since I don't know where codeblocks is installed. Soemetimes I have to remove header file extension (.h) to be able to compile some source. I use gcc as setting for codeblocks to compile and build programs.2. Plugins for Codeblocks can be installed, but when browse codeblocks's wiki I can't find download links neither developer pages
View 3 Replies
View Related
Apr 29, 2011
i got a sample.c which generate a linked list for sorting according to the number generated. then i want to split the sorting function into a header file. and it looks like the sort function in the header file could not access the linked list in the main. the error is dereferencing pointer to incomplete type
sample.c
Code:
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
[code]...
View 2 Replies
View Related
Mar 25, 2011
how I can do a ftp connection putting the user and passwd as default?
View 6 Replies
View Related
Jun 9, 2010
I need to know the header file used at 'c' to support openoffice writter at REDHAT4. I plan to write a c++ program for something like spellbee game. so instead of giving a txtfile which has a list of words as a source for the game I decided to use some header file. My assumptions are: Since the redhat4 is written through the "C" language and as well as the openoffice writter which is a supporting package at this os too might have the linker right. At openoffice writter we have the spellcheck feature which might had a source from where it checks the words whenever we type something at openoffice writer. So is it possible to use those header file or linkage source at my c++ spellbee game program instead off creating the list about few bunch of words.
View 1 Replies
View Related
Feb 14, 2011
Below are the header files and the program:
using namespace std:
View 2 Replies
View Related
Jan 13, 2010
I'm a complete linux beginner and currently have the following board that I am playing around with.the main chip onboard is an atmel arm9 core with a debian style distribution pre-installed. I have just updated the factory kernel to 2.6.30 as I was told this had an inbuilt GPIO driver? I am trying to interface the output pins on the header of the GESBC-9260 to the linux distribution. i.e. I would initially like to write a c file that did something like toggle an output pin, which I can then connect upto an led and see this flash. However I don't really have a clue where to start. Hopefully someone could point me in the right direction?
View 1 Replies
View Related
Jul 21, 2010
Where is the perl module for programming with sockets?
View 4 Replies
View Related
May 21, 2011
i am a new programer in c i have write a simple app and i have a problem with combiling my program include one header file and 2 c
fun.h
#include<stdio.h>
void f();
/******EOF*******/
fun.c
#include"fun.h"
void f(){
[Code].....
View 6 Replies
View Related