Sponsored Content
Top Forums Shell Programming and Scripting Perl newbie question re: variables Post 302355422 by pludi on Tuesday 22nd of September 2009 04:32:43 PM
Old 09-22-2009
You mean like this:
Code:
$ perl -we '$str = "old"; ( $var = $str ) =~ s/old/new/; print $str, "\n", $var, "\n";'
old
new

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

newbie question

hi im thinking of getting unix but i have no idea where to start I know that its an OS similar to linux but what hardware does in run on? i've heard of solaris but im not quit sure what it is thankxs (3 Replies)
Discussion started by: ninja
3 Replies

2. UNIX Desktop Questions & Answers

Newbie Question

I am fairly new to *nix/linux and I have just installed SuSe 8.2. I am wondering what skills would be good to learn. I know that I will need to learn how to write scripts, but what scripting languages should I learn. I greatly appreciate any and all comments. ... (5 Replies)
Discussion started by: Ntalektual
5 Replies

3. Shell Programming and Scripting

Newbie question

Hello, I have text file while looks this test1 test2 test3 test4 test5 test6 and if I want to parse it and make new file which would like this test1 test2 test3 test4 test5 test6 How can I do this in korn shell script Thanks (9 Replies)
Discussion started by: peeyush_23
9 Replies

4. Shell Programming and Scripting

Perl newbie question

Can someone tell me what this is doing? I know it is reading records from a table and puts them in a hash. How do I print out, let's say, the first 5 columns of data (assuming columns are named col1, col2, ...)? $sth = $dbh->prepare("select * from stsc.loc ... (2 Replies)
Discussion started by: ssmiths001
2 Replies

5. UNIX for Dummies Questions & Answers

UNIX newbie NEWBIE question!

Hello everyone, Just started UNIX today! In our school we use solaris. I just want to know how do I setup Solaris 10 not the GUI one, the one where you have to type the commands like ECHO, ls, pwd, etc... I have windows xp and I also have vmware. I hope I am not missing anything! :p (4 Replies)
Discussion started by: Hanamachi
4 Replies

6. Shell Programming and Scripting

perl newbie . &&..programming newbie (question 2)

Hello everyone, I am having to do a lot of perl scripting these days and I am learning a lot. I have this problem I want to move files from a folder and all its sub folders to one parent folder, they are all .gz files.. there is folder1\folder2\*.gz and there are about 50 folders... (1 Reply)
Discussion started by: xytiz
1 Replies

7. Shell Programming and Scripting

perl newbie . &&..programming newbie

Hi, I am new to programming and also to perl..But i know 'perl' can come to my rescue, But I am stuck at many places and need help..any small help is much appreciated... below is the description of what i intend to acheive with my script. I have a files named in this format... (13 Replies)
Discussion started by: xytiz
13 Replies

8. UNIX for Dummies Questions & Answers

perl newbie question

I have the following question in perl, I have come up with couple of solutions,Perl gurus please help me find the best answer to my question? You have a PERL database named DataEntryData, and you need to separate out the various values from the DB entry $item, delimited by the ^ sumbol. There... (2 Replies)
Discussion started by: ramky79
2 Replies

9. Shell Programming and Scripting

Hidden Characters in Regular Expression Matching Perl - Perl Newbie

I am completely new to perl programming. My father is helping me learn said programming language. However, I am stuck on one of the assignments he has given me, and I can't find very much help with it via google, either because I have a tiny attention span, or because I can be very very dense. ... (4 Replies)
Discussion started by: kittyluva2
4 Replies

10. Programming

PERL: In a perl-scripttTrying to execute another perl-script that SETS SOME VARIABLES !

I have reviewed many examples on-line about running another process (either PERL or shell command or a program), but do not find any usefull for my needs way. (Reviewed and not useful the system(), 'back ticks', exec() and open()) I would like to run another PERL-script from first one, not... (1 Reply)
Discussion started by: alex_5161
1 Replies
curs_instr(3X)															    curs_instr(3X)

NAME
instr, innstr, winstr, winnstr, mvinstr, mvinnstr, mvwinstr, mvwinnstr - get a string of characters from a curses window SYNOPSIS
#include <curses.h> int instr(char *str); int innstr(char *str, int n); int winstr(WINDOW *win, char *str); int winnstr(WINDOW *win, char *str, int n); int mvinstr(int y, int x, char *str); int mvinnstr(int y, int x, char *str, int n); int mvwinstr(WINDOW *win, int y, int x, char *str); int mvwinnstr(WINDOW *win, int y, int x, char *str, int n); DESCRIPTION
These routines return a string of characters in str, extracted starting at the current cursor position in the named window. Attributes are stripped from the characters. The four functions with n as the last argument return a leading substring at most n characters long (exclu- sive of the trailing NUL). RETURN VALUE
All of the functions return ERR upon failure, or the number of characters actually read into the string. X/Open defines no error conditions. In this implementation, if the window parameter is null or the str parameter is null, a zero is returned. NOTES
Note that all routines except winnstr may be macros. PORTABILITY
SVr4 does not document whether a length limit includes or excludes the trailing NUL. The ncurses library extends the XSI description by allowing a negative value for n. In this case, the functions return the string ending at the right margin. SEE ALSO
curses(3X). curs_instr(3X)
All times are GMT -4. The time now is 07:07 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy