Sponsored Content
Top Forums Shell Programming and Scripting Array Length Reports as Having Length when it is Empty? Post 302700521 by Corona688 on Thursday 13th of September 2012 01:55:52 PM
Old 09-13-2012
Quote:
Originally Posted by mrm5102
I get it's MUCH more efficient, but after just trying both ways side-by-side, the difference in speed and cpu is unnoticeable...
Ever wonder why flash ads are so good at making computers lag and freeze? They can't have been that bad on the author's computer. And certainly, running by themselves on a studio-grade machine, a flash ad can chug along just fine even jammed on 100% quality maximum framerate. It's when you start putting 3 of them on one page that they start misbehaving and competing with each other. But they work fine for the author, and that's good enough for them!

If your program's the only thing ever running on that computer, it will be okay. But that's not a good habit to learn; someday you won't be able to get away with it. And it makes life so difficult for you anyway...
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

creating a fixed length output from a variable length input

Is there a command that sets a variable length? I have a input of a variable length field but my output for that field needs to be set to 32 char. Is there such a command? I am on a sun box running ksh Thanks (2 Replies)
Discussion started by: r1500
2 Replies

2. UNIX for Dummies Questions & Answers

Sed working on lines of small length and not large length

Hi , I have a peculiar case, where my sed command is working on a file which contains lines of small length. sed "s/XYZ:1/XYZ:3/g" abc.txt > xyz.txt when abc.txt contains lines of small length(currently around 80 chars) , this sed command is working fine. when abc.txt contains lines of... (3 Replies)
Discussion started by: thanuman
3 Replies

3. UNIX for Dummies Questions & Answers

Length of a Unix filepath max length

Hi Guys, Could anyone shed some light on the length of a Unix filepath max length pls ? thanks ! Wilson (3 Replies)
Discussion started by: wilsontan
3 Replies

4. UNIX for Dummies Questions & Answers

What the command to find out the record length of a fixed length file?

I want to find out the record length of a fixed length file? I forgot the command. Any body know? (9 Replies)
Discussion started by: tranq01
9 Replies

5. Shell Programming and Scripting

Make variable length record a fixed length

Very, very new to unix scripting and have a unique situation. I have a file of records that contain 3 records types: (H)eader Records (D)etail Records (T)railer Records The Detail records are 82 bytes in length which is perfect. The Header and Trailer records sometimes are 82 bytes in... (3 Replies)
Discussion started by: jclanc8
3 Replies

6. Shell Programming and Scripting

changing a variable length text to a fixed length

Hi, Can anyone help with a effective solution ? I need to change a variable length text field (between 1 - 18 characters) to a fixed length text of 18 characters with the unused portion, at the end, filled with spaces. The text field is actually field 10 of a .csv file however I could cut... (7 Replies)
Discussion started by: dc18
7 Replies

7. Shell Programming and Scripting

Generate 100 Character Fixed Length Empty File

Hello Everyone, I'm running AIX 5.3 and need to generate a 100 character fixed length empty file from within a bash script that I am developing. I searched and was able to find: dd if=/dev/zero of=/test/path/file count=100 however my understanding is that this will generate a file of a... (10 Replies)
Discussion started by: jvt
10 Replies

8. Shell Programming and Scripting

Flat file-make field length equal to header length

Hello Everyone, I am stuck with one issue while working on abstract flat file which i have to use as input and load data to table. Input Data- ------ ------------------------ ---- ----------------- WFI001 Xxxxxx Control Work Item A Number of Records ------ ------------------------... (5 Replies)
Discussion started by: sonali.s.more
5 Replies

9. Shell Programming and Scripting

Convert variable length record to fixed length

Hi Team, I have an issue to split the file which is having special chracter(German Char) using awk command. I have a different length records in a file. I am separating the files based on the length using awk command. The command is working fine if the record is not having any... (7 Replies)
Discussion started by: Anthuvan
7 Replies
Dancer::Plugin::FlashMessage(3pm)			User Contributed Perl Documentation			 Dancer::Plugin::FlashMessage(3pm)

NAME
Dancer::Plugin::FlashMessage - Dancer plugin to display temporary messages, so called "flash messages". VERSION
version 0.314 DESCRIPTION
This plugin helps you display temporary messages, so called "flash messages". It provides a "flash()" method to define the message. The plugin then takes care of attaching the content to the session, propagating it to the templating system, and then removing it from the session. However, it's up to you to have a place in your views or layout where the message will be displayed. But that's not too hard (see SYNOPSYS). Basically, the plugin gives you access to the 'flash' hash in your views. It can be used to display flash messages. By default, the plugin works using a decent configuration. However, you can change the behaviour of the plugin. See CONFIGURATION NAME
Dancer::Plugin::FlashMessage - A plugin to display "flash messages" : short temporary messages SYNOPSYS
Example with Template Toolkit In your configuration, make sure you have session configured. Of course you can use any session engine : session: "simple" In your index.tt view or in your layout : <% IF flash.error %> <div class=error> <% flash.error %> </div> <% END %> In your css : .error { background: #CEE5F5; padding: 0.5em; border: 1px solid #AACBE2; } In your Dancer App : package MyWebService; use Dancer; use Dancer::Plugin::FlashMessage; get '/hello' => sub { flash error => 'Error message'; template 'index'; }; METHODS
flash # sets the flash message for the warning key flash warning => 'some warning message'; # retrieves and removes the flash message for the warning key my $warning_message = flash 'warning'; This method can take 1 or 2 parameters. When called with two parameters, it sets the flash message for the given key. When called with one parameter, it returns the value of the flash message of the given key. The message is deleted from the flash hash in the session. In both cases, "flash" always returns the value; IN YOUR TEMPLATE
After having set a flash message using "flash" in your Dancer route, you can access the flash message from within your template. The plugin provides you with the "flash" hashref, that you can access in your template, for example like this : <div class=error> <% flash.error %> </div> When you use it in your template, the flash message is deleted. So next time, "flash.error" will not exist. CONFIGURATION
With no configuration whatsoever, the plugin will work fine, thus contributing to the keep it simple motto of Dancer. configuration default values These are the default values. See below for a description of the keys plugins: FlashMessage: token_name: flash session_hash_key: _flash configuration description token_name The name of the template token that will contain the hash of flash messages. Default : "flash" session_hash_key You probably don't need that, but this setting allows you to change the name of the session key used to store the hash of flash messages. It may be useful in the unlikely case where you have key name conflicts in your session. Default : "_flash" COPYRIGHT
This software is copyright (c) 2011 by Damien "dams" Krotkine <dams@cpan.org>. LICENCE
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. AUTHORS
This module has been written by Damien "dams" Krotkine <dams@cpan.org>. SEE ALSO
Dancer AUTHOR
Damien "dams" Krotkine COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Damien "dams" Krotkine. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2011-11-26 Dancer::Plugin::FlashMessage(3pm)
All times are GMT -4. The time now is 02:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy