I am trying to install GCC-3.1.1 on an SGI Indigo2. I already have MIPSpro 7.2.1 installed. However, when I try to configure GCC-3.1.1, I get the message "cc ERROR: cc -o conftest -g failed, You must set the environment variable CC to a working compiler."
What is the name of the MIPSpro c++... (1 Reply)
Dear friends,
i am writing csh script
i have one dat file containing following data.like this.
08FD3 03A26 000FA0 FFFF0 BBA0F 00000 00000
from the above file i want to read each letter and store it in one variable.
how it is possible.
please help (7 Replies)
L=0
cat test.sh | while read line
do
L='expr $1 + 1'
echo $L
done
echo $l
>>> the echo $L at the end produces 0 but i actually want it to produce the number of lines - any idea why this is happening? (16 Replies)
Hi All,
I need to have a sed command insert the letter i at the end of some lines in a file.
Problem is that where I want to add the i is after variables that change in each file
eg, tsal314384'
tsal315386'
tsal317392'
I need to have it like this
... (2 Replies)
Total Bash noob, have been successful in doing my script by searching and looking at examples, but I need some assitance with this one, just can't figure it out.
In the Bash script I am trying to capitalize the first letter of every word in a string, ideally not changing other capitalization.
... (5 Replies)
Hi all,
I want to set the last 4 letter in the filename as a variable.
For example, i have AB1234.txt file and i need to have last 4 letter as a variable.
It should be like ;
get last four letter
set var = 1234
How can i write this in C shell??
Thanks,
zibi (3 Replies)
Hi
I have e.g. VAR1=january and I need to change it into VAR1=January.
How to change value of VAR1 variable to always set first character uppercase and other lowercase ?
thx for help. (9 Replies)
I am trying to make a script that takes a word and each letter up and turns it into a separate variable. My code currently does not work but I feel I just need to tweak one thing that I am unsure of.
(ex: if forum was typed in letter1=f; letter2=o; letter3=r;...)
Thank you
count=1;
... (7 Replies)
Hi to all in forum,
I'm trying to convert the letter number between 1 (A) and 26 (Z), that part is working, my issue is how to assign the printf output to a variable:LetterNumber=10
printf "\x$(printf %x $((${LetterNumber}+64)))"
$ J
#The problem, how to assign printf output (J in this... (8 Replies)
Good afternoon all,
I want to ask how to change some letter in my file with other letter in spesific line
eg.
data.txt
1
1
1
0
0
0
0
for example i want to change the 4th line with character 1.
How could I do it by SED or AWK.
I have tried to run this code but actually did not... (3 Replies)
Discussion started by: weslyarfan
3 Replies
LEARN ABOUT DEBIAN
data::clone
Data::Clone(3pm) User Contributed Perl Documentation Data::Clone(3pm)NAME
Data::Clone - Polymorphic data cloning
VERSION
This document describes Data::Clone version 0.003.
SYNOPSIS
# as a function
use Data::Clone;
my $data = YAML::Load("foo.yml"); # complex data structure
my $cloned = clone($data);
# makes Foo clonable
package Foo;
use Data::Clone;
# ...
# Foo is clonable
my $o = Foo->new();
my $c = clone($o); # $o is deeply copied
# used for custom clone methods
package Bar;
use Data::Clone qw(data_clone);
sub clone {
my($proto) = @_;
my $object = data_clone($proto);
$object->do_something();
return $object;
}
# ...
# Bar is also clonable
$o = Bar->new();
$c = clone($o); # Bar::clone() is called
DESCRIPTION
"Data::Clone" does data cloning, i.e. copies things recursively. This is smart so that it works with not only non-blessed references, but
also with blessed references (i.e. objects). When "clone()" finds an object, it calls a "clone" method of the object if the object has a
"clone", otherwise it makes a surface copy of the object. That is, this module does polymorphic data cloning.
Although there are several modules on CPAN which can clone data, this module has a different cloning policy from almost all of them. See
"Cloning policy" and "Comparison to other cloning modules" for details.
Cloning policy
A cloning policy is a rule that how a cloning routine copies data. Here is the cloning policy of "Data::Clone".
Non-reference values
Non-reference values are copied normally, which will drop their magics.
Scalar references
Scalar references including references to other types of references are not copied deeply. They are copied on surface because it is
typically used to refer to something unique, namely global variables or magical variables.
Array references
Array references are copied deeply. The cloning policy is applied to each value recursively.
Hash references
Hash references are copied deeply. The cloning policy is applied to each value recursively.
Glob, IO and Code references
These references are not copied deeply. They are copied on surface.
Blessed references (objects)
Blessed references are not copied deeply by default, because objects might have external resources which "Data::Clone" could not deal with.
They will be copied deeply only if "Data::Clone" knows they are clonable, i.e. they have a "clone" method.
If you want to make an object clonable, you can use the "clone()" function as a method:
package Your::Class;
use Data::Clone;
# ...
my $your_class = Your::Class->new();
my $c = clone($your_object); # $your_object->clone() will be called
Or you can import "data_clone()" function to define your custom clone method:
package Your::Class;
use Data::Clone qw(data_clone);
sub clone {
my($proto) = @_;
my $object = data_clone($proto);
# anything what you want
return $object;
}
Of course, you can use "Clone::clone()", "Storable::dclone()", and/or anything you want as an implementation of "clone" methods.
Comparison to other cloning modules
There are modules which does data cloning.
"Storable" is a standard module which can clone data with "dclone()". It has a different cloning policy from "Data::Clone". By default it
tries to make a deep copy of all the data including blessed references, but you can change its behaviour with specific hook methods.
"Clone" is a well-known cloning module, but it does not polymorphic cloning. This makes a deep copy of data regardless of its types.
Moreover, there is no way to change its behaviour, so this is useful only for data which link to no external resources.
"Data::Clone" makes a deep copy of data only if it knows that the data are clonable. You can change its behaviour simply by defining
"clone" methods. It also exceeds "Storable" and "Clone" in performance.
INTERFACE
Exported functions
clone(Scalar)
Returns a copy of Scalar.
Exportable functions
data_clone(Salar)
Returns a copy of Scalar.
The same as "clone()". Provided for custom clone methods.
is_cloning()
Returns true inside the "clone()" function, false otherwise.
DEPENDENCIES
Perl 5.8.1 or later, and a C compiler.
BUGS
No bugs have been reported.
Please report any bugs or feature requests to the author.
SEE ALSO
Storable
Clone
AUTHOR
Goro Fuji (gfx) <gfuji(at)cpan.org>
LICENSE AND COPYRIGHT
Copyright (c) 2010, Goro Fuji (gfx). All rights reserved.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.14.2 2011-01-15 Data::Clone(3pm)