Sponsored Content
Top Forums Shell Programming and Scripting Perl: Getting back reference from s modifier Post 302176555 by cooldude on Tuesday 18th of March 2008 02:00:08 PM
Old 03-18-2008
perl should have given me an error/warning because the s modifier isn't applicable to -p.
Anyway, here's what I tried, but this time I get nothing outputted:
Code:
perl -e -0777 "s/func_a\((.*)?\);/func_b(\1,\n6)/s" < file |more

and
Code:
perl -e "BEGIN {$/=undef} s/func_a\((.*)?\);/func_b(\1,\n6)/s"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

back reference error

Hi, i am getting this error........ find ./ | sed '/\(*\) \(*\)/\2\1/' Unrecognized command: /\(*\) \(*\)/\2\1/ Any idea??? regards Apoorva Kumar (4 Replies)
Discussion started by: apoorvasharma80
4 Replies

2. Shell Programming and Scripting

Perl reference

Hi all, I have a reference named $test. it points to the data structure as follows 'test' => }, ... (1 Reply)
Discussion started by: Damon sine
1 Replies

3. Shell Programming and Scripting

Shell Scripting Problem - Invalid Back Reference

Here is the question... Create a new script, sub2, taking three parameters... 1.) the string to be replaced 2.) the string with which to replace it 3.) the name of the file in which to make the substitution ...that treats the string to be replaced as plain text instead of as a regular... (1 Reply)
Discussion started by: johnhisenburg
1 Replies

4. Shell Programming and Scripting

Perl de-reference code reference variable

Guys, May i know how can we de reference the code reference variable.? my $a = sub{$a=shift;$b=shift;print "SUM:",($a+$b),"\n";}; print $a->(4,5); How can we print the whole function ? Please suggest me regarding this. Thanks for your time :) Cheers, Ranga :) (0 Replies)
Discussion started by: rangarasan
0 Replies

5. UNIX for Dummies Questions & Answers

Invalid back reference

The thread can be closed now :D. (3 Replies)
Discussion started by: vaz0r
3 Replies

6. Shell Programming and Scripting

Reference of hash (Perl)

Hi Perl users, Could somebody help me to find the solution of my problem below. Here is my data: __DATA__ =================================================== NameOfipaddress ippair_1 propertiesx y propertiesy x... (1 Reply)
Discussion started by: askari
1 Replies

7. Shell Programming and Scripting

Perl :: reading values from Data Dumper reference in Perl

Hi all, I have written a perl code and stored the data into Data structure using Data::Dumper module. But not sure how to retreive the data from the Data::Dumper. Eg. Based on the key value( Here CRYPTO-6-IKMP_MODE_FAILURE I should be able to access the internal hash elements(keys) ... (1 Reply)
Discussion started by: scriptscript
1 Replies

8. Shell Programming and Scripting

sed back reference error

I am trying to change a single line of a special file whose comment character is ! to show a path to the file in the comment. such as: !!HFSS and mcm path: \Signal_Integrity\Package_SI\Section_Models\C4toTrace\28nm\D6HS\SLC_5-2-5\GZ41_ICZ\NSSS\ to a different path and replace the !!HFSS... (1 Reply)
Discussion started by: mobrien601
1 Replies

9. UNIX for Dummies Questions & Answers

Extract text in sed using back reference

i have a text 20 21 22 23 24 25 26 i want to get 22 using sed back reference. I have used sed 's/{6}\(..\).*/\1/' but, it does not work. I am missing something somewhere. Please help. (5 Replies)
Discussion started by: gotamp
5 Replies

10. Shell Programming and Scripting

sed - use back reference in 2nd command

I have data that looks like this: <Country code="US"><tag>adsf</tag><tag>bdfs</tag></Country><Country code="CA"><tag>asdf</tag><tag>bsdf</tag></Country> I want to grab the country code save it, then drop each new "<..." onto a new line with the country code added to the beginning of each So,... (9 Replies)
Discussion started by: JenniferAmon
9 Replies
Gearman::Server::Client(3pm)				User Contributed Perl Documentation			      Gearman::Server::Client(3pm)

NAME
Gearman::Server::Client - client for gearmand NAME
Used by Gearman::Server to instantiate connections from clients. Clients speak either a binary protocol, for normal operation (calling functions, grabbing function call requests, returning function values, etc), or a text-based line protocol, for relatively rare administrative / monitoring commands. The binary protocol commands aren't currently documented. (FIXME) But they're well-implemented in Gearman::Client, Gearman::Worker, and Gearman::Client::Async, if that's any consolation. The line-based administrative commands are documented below. Binary Protocol Structure All binary protocol exchanges between clients (which can be callers, workers, or both) and the Gearman server have common packet header: 4 byte magic -- either "REQ" for requests to the server, or "RES" for responses from the server 4 byte type -- network order integer, representing the packet type 4 byte length -- network order length, for data segment. data -- optional, if length is non-zero Binary Protocol Commands echo_req (type=16) A debug command. The server will reply with the same data, in a echo_res (type=17) packet. (and many more...) FIXME: auto-generate protocol docs from internal Gearman::Util table, once annotated with some English? Line based commands These commands are used for administrative or statistic tasks to be done on the gearman server. They can be entered using a line based client (telnet, etc.) by connecting to the listening port(7003) and are also intended to be machine parsable. "workers" Emits list of registered workers, their fds, IPs, client ids, and list of registered abilities (function names they can do). Of format: fd ip.x.y.z client_id : func_a func_b func_c fd ip.x.y.z client_id : func_a func_b func_c fd ip.x.y.z client_id : func_a func_b func_c . It ends with a line with just a period. "status" The output format of this function is tab separated columns as follows, followed by a line consisting of a fullstop and a newline (". ") to indicate the end of output. Function name A string denoting the name of the function of the job Number in queue A positive integer indicating the total number of jobs for this function in the queue. This includes currently running ones as well (next column) Number of jobs running A positive integer showing how many jobs of this function are currently running Number of capable workers A positive integer denoting the maximum possible count of workers that could be doing this job. Though they may not all be working on it due to other tasks holding them busy. "jobs" Output format is zero or more lines of: [Job function name] [Uniq (coalescing) key] [Worker address] [Number of listeners] Follows by a single line of: . is a literal tab character is perl's definition of newline (literal on linux, something else on win32) "clients" Output format is zero or more sections of: One line of: [Client Address] Followed by zero or more lines of: [Job Function] [Uniq (coalescing) key] [Worker Address] Follows by a single line of: . is a literal tab character is perl's definition of newline (literal on linux, something else on win32) "maxqueue" function [max_queue_size] For a given function of job, the maximum queue size is adjusted to be max_queue_size jobs long. A negative value indicates unlimited queue size. If the max_queue_size value is not supplied then it is unset (and the default maximum queue size will apply to this function). This function will return OK upon success, and will return ERR incomplete_args upon an invalid number of arguments. "shutdown" ["graceful"] Close the server. Or "shutdown graceful" to close the listening socket, then close the server when traffic has died away. "version" Returns server version. perl v5.10.1 2011-02-14 Gearman::Server::Client(3pm)
All times are GMT -4. The time now is 01:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy